I've created a Jersey POST API, that is getting text/plain as the body. I've tried this API locally and it was working as expected, but after deploying it to a server, I get 415 Unsupported Media Type.
This is the code:
@POST
@Path("/dodo")
@Consumes({MediaType.TEXT_PLAIN})
@Produces({MediaType.APPLICATION_JSON})
public Response Dodo(String input){
return Response.status(200).entity(new JerseyDto(input,12)).build();
}
This is the error I see in the log:
com.sun.jersey.spi.container.ContainerRequest getEntity
SEVERE: A message body reader for Java class java.lang.String, and Java type class java.lang.String, and MIME media type text/plain was not found.
The registered message body readers compatible with the MIME media type are:
*/* ->
com.fasterxml.jackson.jaxrs.json.JacksonJsonProvider
Any thoughts?