I have a Jersey2 service with a POST method handler
@Path("register")
public class RegisterResource {
@XmlRootElement
class PostUserParams {
String username;
String password;
public PostUserParams() {}
}
@POST
@Consumes(MediaType.APPLICATION_JSON)
public postData(PostUserParams user) {
...
}
}
But I can't get the POST request to work - I already get 415 Unsupported Media Type. I'm pretty sure that
- I have the correct Content-Type in the request
- moxy, jaxb and all the jars and dependencies are properly deployed
- I even tried to add some moxy configuration for jersey, but that doesn't seem to be necessary according to the docs
- other requests not involving JSON to Java conversion work fine
- the JSON in the request is correct
What gives?