How to set charset with wrapped resource?

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
Report Content as Inappropriate

How to set charset with wrapped resource?

This post has NOT been accepted by the mailing list yet.
This post was updated on .
There is an interface DirAttributeResource

    public void addEntry(PojoDirectoryEntry value);

The client resource to excute

DirAttributeResource connectionResource = clientResource.wrap(DirAttributeResource.class);

Got the exception Unsupported Media Type (415).

But when I used Firefox restclient console to send same request, it works well.

I capture these 2 http packages with wireshark and compare.
Found that the content-type in failed request header only has the application/json but no charset=utf-8

I have tried to add the below lines before addEntry(data), but useless:
        Representation entity = new StringRepresentation("",
                MediaType.APPLICATION_ALL_JSON, Language.DEFAULT,

So my question is how to set the charset=utf-8 with wrapped resource class?