users@jersey.java.net

[Jersey] Re: Best way to diagnose a 400 error on POST

From: Paul Sandoz <Paul.Sandoz_at_oracle.com>
Date: Mon, 13 Dec 2010 10:40:27 +0100

Hi Jason,

Any error in the server side logs?

Paul.

On Dec 10, 2010, at 6:10 AM, Jason Erickson wrote:

> Hi. I have a REST method defined thus:
> @POST
> @Consumes(MediaType.APPLICATION_JSON)
> public Response addObservationSession(ObservationSession session,
> @Context UriInfo uriInfo) throws URISyntaxException
> {
> .. do some stuff
> return Response.created(new URI("/" + session.getId())).build();
> }
>
> This is giving me a 400 error when I call it. Clearly it doesn't
> like my JSON string, but it's hard for me to tell what's wrong with
> it (or if it's not the string, maybe it's the header or who knows).
> I can't put a breakpoint in my code because it never gets to my
> code. What's the best way to get a clue?