users@jersey.java.net

[Jersey] Re: Error message for PUT request not delivered to client

From: Pavel Bucek <pavel.bucek_at_oracle.com>
Date: Tue, 29 Mar 2011 10:43:16 +0200

Hello,

can you do something like:

System.out.println("DEBUG: " + pot.response.getEntity(String.class));

?

I've tested something similar to your case and everything seems to work
as expected..

Pavel

On 3/29/11 10:04 AM, oerding_at_match2blue.com wrote:
> It seems to be a problem on the client side, using curl I got
> {"error":{"code":105,"message":"Application key \"null\" is NOT
> defined!"}}
> exactly as expected.
>
> My code for the request is:
>
> final String url = "spheres/" + sphereName + "/accounts/" + email;
> final WebResource putAccount = pat.getWebResource( url, user );
>
> pat.response = putAccount.header( Constants.X_MATOOI_APIKEY, apiKey )
> .type( MediaType.APPLICATION_FORM_URLENCODED ).put(
> ClientResponse.class, sb.toString( ).getBytes( ) );
>
> where the important point is the request putAccount.header... and sb is
> a StringBuilder containing the JSON representation of the account to
> update.
>
> But I do not get it where my code is wrong.
>