users@jersey.java.net

[Jersey] Why setting .type in Jersey Client?

From: Daniel <drehmann.daniel_at_googlemail.com>
Date: Mon, 02 Jul 2012 09:25:09 +0200

I want to send a Form to my Rest Service with Jersey. It is working like
this:

| //create form
  //fill form
  service.path("rest").path("foo").accept(MediaType.APPLICATION_JSON).post(ClientResponse.class, form);
|

So why should I use:

| .type(MediaType.APPLICATION_FORM_URLENCODED_TYPE)
|

in it, when it's working without it? Same with plain text as string and
so on. Where is the advantage of setting this?