Questions tagged [jersey-client]

The Jersey client API is a high-level Java based API for interoperating with RESTful Web services.

The Jersey client API is a high-level Java based API for interoperating with RESTful Web services. It makes it very easy to interoperate with RESTful Web services and enables a developer to concisely and efficiently implement a reusable client-side solution that leverages existing and well established client-side HTTP implementations.

More Details

820 questions
3
votes
2 answers

Send list of query parameters to jersey client using GET in jersey 2.x?

In jersey version 1.4 (at least that's the only reference I can find online) there was com.sun.jersey.api.client.WebResource where you could send a list of parameters using Webresource.queryParams() ... seems that method no longer exists in…
Esko
  • 129
  • 1
  • 3
  • 12
3
votes
1 answer

JAXRS client - Deserialization Issue with Pojo

Helo Everyone. I am new to jersey and Jackson and finding it really difficult to deserialize a JSOn response from my REST service on client side. I am pretty sure that I am still not grasping the Object mapper and JSON provider APIs that well. Any…
nishiz
  • 55
  • 8
3
votes
1 answer

JAX-RS Jersey client gets 400 response when web method parameters are annotated

Here is my web service method: @Produces(MediaType.APPLICATION_JSON) @Consumes(MediaType.APPLICATION_JSON) @POST @Path("login") public Response login(@NotNull @Valid Credentials credentials) { // do login } And here is the snippet of the client…
jFrenetic
  • 5,384
  • 5
  • 42
  • 67
3
votes
2 answers

How to use SSL with Jersey 2.x and Apache Connection manager

I would like to use connection pooling with my Jersey 2.x rest clients. I have the following code: ClientConfig clientConfig = new ClientConfig(); PoolingHttpClientConnectionManager connectionManager = new…
user1585916
  • 793
  • 7
  • 15
3
votes
1 answer

Jersey-client basic authentication

I'm trying to send a REST-request over HTTPS that includes basic authentication in the HTTP header, the problem seem to be that the authentication does not get inserted into the header. HttpAuthenticationFeature feature =…
vonyx
  • 31
  • 1
  • 1
  • 3
3
votes
1 answer

Maven dependency for testing using Jersey Test Framework

I am trying to test a Restful service using Jersey Test Framework , I have the following code in place. import java.io.UnsupportedEncodingException; import java.net.URISyntaxException; import java.net.URLEncoder; import…
user1965449
  • 2,849
  • 6
  • 34
  • 51
3
votes
1 answer

Correct handling of background calls in jersey

I have to do some background calls to a web service within a web application. The response of the call is not really time-critical and barely interesting for me. It changes only in rare cases, where I will react to it by throwing a exception, or…
mailman
  • 149
  • 1
  • 10
3
votes
2 answers

jersey-client MessageBodyWriter not found for media type=application/x-www-form-urlencoded

Using org.glassfish.jersey.core.jersey-client version 2.16 and can't seem to make a simple POST request: MessageBodyProviderNotFoundException: MessageBodyWriter not found for media type=application/x-www-form-urlencoded client String response =…
Andrew Eells
  • 735
  • 12
  • 30
3
votes
1 answer

RestEasy's Client implementation causes javax.net.ssl.SSLException: hostname in certificate didn't match

The similar question has been answered many times before but I have a pretty strange behavior. Using Jersey client implementation the code works fine and I get the '200 OK' status. However, If I use RestEasy's client I get the above exception. Now…
Arthur Eirich
  • 3,368
  • 9
  • 31
  • 63
3
votes
1 answer

Jersey(2.10.4) Entity provider selection algorithm gives less priority to custom providers(MessageBodyWriter) making it not to be invoked

We have a custom MessageBodyWriter in our application that produces data of Media type application/xml.As we know Jersey 2.x has an algorithm(https://jersey.java.net/documentation/latest/message-body-workers.html#mbw.writer.selection.algorithm) that…
3
votes
2 answers

How to handle read timeout exception in jersey client 1.8

I am using jersey 1.8 to call an external service. Here is my code. try{ ClientResponse response = webResource.header(HttpHeaders.AUTHORIZATION, encodedHashString).type(MediaType.APPLICATION_FORM_URLENCODED_TYPE).post(ClientResponse.class,…
Nirmal Mangal
  • 812
  • 1
  • 12
  • 26
3
votes
1 answer

Jackson Processing Issue

I've been pulling my hair out on this one for days. I can't figure out what is happening. I am developing a WebApp using GWT which communicates with a different server using RestAPI. I use Jersey client to communicate to a different server from…
Andrew Phillips
  • 937
  • 1
  • 7
  • 19
3
votes
0 answers

want long-polling using restful API of jersey 2

My requirement: I want to make API like dropbox's /longpoll_delta,I have useed jerser 2 in java for my restful. Actually I want to notify all client when there is change found on server. So server may take 2hr or more then notify all its client that…
HybrisHelp
  • 5,518
  • 2
  • 27
  • 65
3
votes
0 answers

Jersey client not following redirects?

I am struggling to get a Jersey client that follows redirects, even though "I know I had this working earlier." (Haven't looked at the code in a while). I thought had a complex case where it was failing when the redirect was from HTTP to HTTPS. But…
Steve Lane
  • 759
  • 1
  • 5
  • 13
3
votes
2 answers

Jersey test keeps failing with MessageBodyReader not found when reading entity?

I have a REST api that returns an object in json format, with Content-Type of application/json, pretty standard. I'm creating a basic TestNg Jersey test using Jersey's test framework, and want to run a simple test against an external container…
Edy Bourne
  • 5,679
  • 13
  • 53
  • 101