How to fix Jersey POST request parameters warning?

Viewed 48260

I'm building a very simple REST API using Jersey, and I've got a warning in my log files that I'm not sure about.

WARNING: A servlet POST request, to the URI http://myserver/mycontext/myapi/users/12345?action=delete, contains form parameters in the request body but the request body has been consumed by the servlet or a servlet filter accessing the request parameters. Only resource methods using @FormParam will work as expected. Resource methods consuming the request body by other means will not work as expected.

My webapp only has the Jersey servlet defined, mapped to /myapi/*

How can I stop these warnings?

9 Answers

Put this to your resource signature. Or find this string in your project someone already use this if @PUT or @POST is used. This should help

import javax.ws.rs.Consumes;

@Consumes(MediaType.APPLICATION_JSON)
Related