Hi,
I have been going nuts over this over the last few hours and I cannot for
the life of me figure this out.
I have a set of resources that implement the standard REST interface and
provide both XML and JSON interfaces. The XML bit works great and all the
GET, POST and PUT methods work fine.
However, when using application/json as the content-type, "GET" stuff works
great but "POST" refuses to work and I get the following error.
javax.ws.rs.WebApplicationException: javax.xml.bind.UnmarshalException
- with linked exception:
[org.xml.sax.SAXParseException: Content is not allowed in prolog.]
The method I am trying to run through the post is below.
@POST
@Produces({"application/json", "application/xml"})
@Consumes({"application/json", "application/xml"})
public synchronized Response postComment(Comment comment) {
return Response.ok(comment).build();
}
--
View this message in context: http://n2.nabble.com/Posting-JSON-with-Content-Type-application-json-%28jQuery%29-tp1590347p1590347.html
Sent from the Jersey mailing list archive at Nabble.com.