users@jersey.java.net

POST is not working when body is provided

From: Markus Karg <karg_at_quipsy.de>
Date: Mon, 22 Jun 2009 16:04:14 +0200

I can do a PUT to my JAX-RS resource, but I want to use a POST. So I
just replaced @PUT by @POST and kept the rest of the code. Now it does
not work anymore: If the body is empty, everything works well. But if a
body is provided (which shall get attached as a child to the existing
resource, hence the POST instead of the PUT), then it says that it "415
Unsupported Media Type".

 

This is really weird, since PUT works really well, and the media type is
"application/xml" and the body is a InputStream...!

 

Can anybody tell me what to do...?

 

Thanks!

Markus