I'm developing a RESTful websevices project, my question is simple, is there a way to return both 'File' and 'JSON' entities in the same response?
e.g.: suppose I have this method:
@GET
@Path("downloadFile")
@Consumes(MediaType.TEXT_PLAIN)
public Response downloadLogStream( ..... ) {
.....
Response.ok(resultFile);
}
but I need to return another entity beside the file itself without adding additional Headers.
is that possible?
You can send only response but that can be a complex object. Wrap result/json and status in response.
More here
File download