First off, I’m using an older version of Restlet (1.1).
Secondly, I’m not sure I’m doing the correct thing. Here’s what I’m trying to do…
I’m creating a reporting service (resource). I’d like my service to listen for POST requests. The body of the request will contain the report definition. I’d like the response to be the CSV file generated by the service (the report). Is responding to a POST request in this manner OK from a REST standpoint (if not, then how to refine this resource)?
I can’t seem to figure out how the acceptRepresentation() generates the response. I’ve tried setting the Representation parameter passed into the method to a new FileRepresentation. I’ve also tried to utilize the represent() method, but it doesn’t seem like that method is called as part of the POST processing.
How can I accomplish this seeming easy task?
Calling the
getResponse().setEntity()method fromacceptRepresentation()will accept the newFileRepresentationand accomplish what I’d like to.