I’m trying to create a REST service defined as:
@POST
@Path("/path")
@Consumes(MediaType.APPLICATION_XML)
@Produces("multipart/mixed")
public MultipartOutput create(MyObject o) {}
First part of the output will be an XML, second part a text file. In the XML I have the status code that I need, but how can I use it to create the HTTP status code? Currently I receive 200, I need 201.
(For other services, without MultipartOutput, the response is created using ResponseBuilder).
You can use the
@Contextto access theHttpServletResponse.Try changing your method signature and call
setStatus:EDIT :
Try using
org.jboss.resteasy.spi.HttpResponseinstead together with aPostProcessInterceptor: