I have jersey-client-2.25.1 on my build path and I know it has the default provider to convert javax.ws.rs.core.Form to application/x-www-form-urlencoded.
But for this code:
private ClientResponse getResponse(Authorization authInstance, Form formData) {
return webResourceInstance.type(MediaType.APPLICATION_FORM_URLENCODED).
header("Authorization",encode(authInstance)).
post(ClientResponse.class, formData);
}
I keep getting:
com.sun.jersey.api.client.ClientHandlerException: com.sun.jersey.api.client.ClientHandlerException: A message body writer for Java type, class javax.ws.rs.core.Form, and MIME media type, application/x-www-form-urlencoded, was not found
at com.sun.jersey.client.urlconnection.URLConnectionClientHandler.handle(URLConnectionClientHandler.java:155)
I should not have to register a MultiPart class as per this.