Questions tagged [apache-httpcomponents]

A Java library for interacting with HTTP services.

The Apache HttpComponents™ project is responsible for creating and maintaining a toolset of low level Java components focused on HTTP and associated protocols.

See http://hc.apache.org/

For questions related to the HttpClient v4.x component, see

543 questions
15
votes
5 answers

How can I create an empty dummy HttpResponse

I am using org.apache.http.HttpResponse I want to create an empty dummy resposne, I am going to use this to return when errors occur instead of passing back null. I tried to create one and it has lost of weird params. Can someone tell me how to…
jax
  • 37,735
  • 57
  • 182
  • 278
15
votes
1 answer

HttpComponents PoolingHttpClientConnectionManager maxPerRoute and maxTotal?

Can someone please explain to me what setMaxPerRoute(max) and setMaxTotal(max) do in reference to HttpComponents PoolingHttpClientConnectionManager?
james
  • 1,035
  • 2
  • 14
  • 33
15
votes
2 answers

"ConnectionPoolTimeoutException" when iterating objects in S3

I've been working for some time with aws java API with not so many problems. Currently I'm using the library 1.5.2 version. When I'm iterating the objects inside a folder with the following code: AmazonS3 s3 = new AmazonS3Client(new…
Fgblanch
  • 5,195
  • 8
  • 37
  • 51
14
votes
2 answers

Signing AWS HTTP requests with Apache HttpComponents Client

I'm trying to make HTTP requests to an AWS Elasticsearch domain protected by an IAM access policy. I need to sign these requests for them to be authorized by AWS. I'm using Jest, which in turn use Apache HttpComponents Client. This seems to be a…
13
votes
2 answers

Force retry on specific http status code

Dealing with a specific website, sometimes I receive a http response with status code 403. I wanted to re-execute the request in such cases (because, in my specific situation, this server throws a 403 when it is actually overloaded). I tried to use…
Cacovsky
  • 2,536
  • 3
  • 23
  • 27
13
votes
3 answers

What is the right way to sign POST requests with OAuth-Signpost and Apache HttpComponents?

I'm currently using the OAuth-Signpost Java library to sign requests sent from a client to a server which implements OAuth authentication. When making GET requests (using HttpURLConnection) everything works fine: requests are signed, parameters are…
randomau5
  • 131
  • 1
  • 1
  • 3
12
votes
3 answers

How to find HTTP Media Type (MIME type) from response?

While issuing a GET request using Apache HTTP Client v4, how do I obtain the response media type (formally MIME type)? Using Apache HTTP Client v3, the MIME type was obtained with: String mimeType = response.getMimeType(); How do I get the media…
Arvind
  • 6,404
  • 20
  • 94
  • 143
12
votes
4 answers

Error while trying to use an API. java.lang.NoSuchFieldError: INSTANCE

I am trying to connect to the smartsheet api using a java program. Initially I had problems with the site certificate which was resolved by adding it to the java keystore. Now when I am trying to run my code, I get the following error. Exception in…
mahacoder
  • 895
  • 3
  • 14
  • 29
12
votes
2 answers

Apache HTTP client 4.3 credentials per request

I have been having a look to a digest authentication example at: http://hc.apache.org/httpcomponents-client-4.3.x/examples.html In my scenario the there are several threads issuing HTTP requests and each of them has to be authenticated with their…
11
votes
2 answers

How to set Spring HttpComponentsClientHttpRequestFactory with Apache httpcomponent5?

I'm trying to set httpClient5 in Spring ... I have the following code: PoolingHttpClientConnectionManager connectionManager = PoolingHttpClientConnectionManagerBuilder.create() …
fsimone
  • 141
  • 1
  • 1
  • 6
11
votes
0 answers

Apache ConnectionClosedException: Connection closed,HttpAsyncRequestExecutor.endOfInput(HttpAsyncRequestExecutor.java:344)

we have three applications A,B and C deployed on same tomcat server.There is an HTTP call that happens between A to B(REST CALL) and Another http call from B to C(REST CALL) We were using synchronous HTTP call initially,recently we changed our code…
svs teja
  • 957
  • 2
  • 22
  • 43
11
votes
3 answers

Apache Http Client prints "[read] I/O error: Read timed out""

I am using apache http client v4.5 and using it as a REST client. In some cases I recognize an error "[read] I/O error: Read timed out" which comes from the httpclient framework when it reads the received content and shows it as a last message. It…
megloff
  • 1,400
  • 4
  • 27
  • 44
11
votes
1 answer

maven dependency pulling a wrong dependency

The dependency bellow pulls another dependency: httpcore.4.1.4. org.apache.httpcomponents httpclient 4.2 compile Doing so will throws…
DarthVader
  • 52,984
  • 76
  • 209
  • 300
10
votes
1 answer

Apache HTTPClient 4.3.3 execute method for a GET request blocks and never returns

Facing this weird issue since morning, I am making a REST call to a particular endpoint which gives responses in pages so i need to make calls again and again until all pages are completed. My code works fine and dandy until the last page after the…
willsteel
  • 1,037
  • 2
  • 12
  • 21
9
votes
1 answer

Apache HttpCore, simple server to echo received post data

Using the ElementalHttpServer example class found here: https://hc.apache.org/httpcomponents-core-4.3.x/httpcore/examples/org/apache/http/examples/ElementalHttpServer.java I am able to successfully receive post data, my goal is to convert the…
RandomUser
  • 4,140
  • 17
  • 58
  • 94
1
2
3
36 37