users@jersey.java.net

WebResource and type method

From: Alexandre Bertails <alexandre_at_bertails.org>
Date: Thu, 7 May 2009 10:43:31 +0200

Hi all,

I have a problem with jersey-client 1.0.3.

This code is ok :

WebResource wr = ...
wr.path("/path").type(MediaType.MULTIPART_FORM_DATA_TYPE).post(ClientResponse.class,
form);

But this one is not :

WebResource wr = ...
wr.path("/path").type(MediaType.MULTIPART_FORM_DATA_TYPE)
wr.post(ClientResponse.class, form);

The javadoc for the type method is "Set the media type" but it is not
the case as internally, it instantiates a new object.

Ok the return type is not a WebResource but the interfaces are the
same. So it's too easy to fall into the trap...

Is it possible to be clearer and eventually change the documentation ?

Alexandre.