Skip to main content
Filter by
Sorted by
Tagged with
1 vote
2 answers
87 views

1.The following code encapsulates the post method, is EntityUtils.consume(httpEntity); in finally segment code redundant? I asked claudai and he said it's not redundant, and asked chatgpt and he said ...
Rebecca's user avatar
  • 259
0 votes
2 answers
85 views

I have to migrate this httpclient 4 code to httpclient 5: import org.apache.http.client.HttpClient; import org.apache.http.impl.client.HttpClients; import org.apache.http.ssl.SSLContextBuilder; @...
Peter Penzov's user avatar
  • 1,104
0 votes
0 answers
69 views

I migrate legacy application on spring boot 3 Connect httpclient5, and removed the dependency httpclient4, as it conflicts with many modern libraries that use exactlyhttpclient5 And update dependency ...
Mike Sonarov's user avatar
0 votes
0 answers
77 views

my backend Java Spring Boot application is calling a 3rd party web server via restTemplate. I have observed slowness when I switched from std JDK SimpleClientHttpRequestFactory to Apache http client ...
NiharGht's user avatar
  • 161
0 votes
0 answers
35 views

I need to connect to a service that request SSLMA (SSL Mutual Authentication using Apache HttpClient 4.5 and BouncyCastle. I managed to prepare the SSLConnectionSocketFactory instance (see code) but ...
user1391606's user avatar
0 votes
1 answer
62 views

I am trying to use a Jersey (3.x) client with ApacheConnector but I observed that in case a chunked gzip response is received. the connection gets closed as soon as the response is read. The ...
user29495070's user avatar
0 votes
1 answer
631 views

When migrating from httpclient 4.x to httpclient5. I was able to get all the packages sorted except for SSLContexts. There is a line of code that we were using: return SSLContexts.custom().useTLS()....
hell_storm2004's user avatar
1 vote
0 answers
173 views

My logic calls two consecutive POST requests from RestTemplate in SpringBoot. The first call always succeeds but the second call always fails with: I/O error on POST request for "https://httpbin....
Matthias M's user avatar
  • 15.1k
0 votes
0 answers
79 views

I get an SSLPeerUnverifiedException after switching from HTTP to HTTPS which I don't understand since the wildcard certificate should work for the URL. javax.net.ssl.SSLPeerUnverifiedException: ...
Adrian's user avatar
  • 173
0 votes
1 answer
38 views

I want to call this method regularly to clean up Apache HTTP connection pool in an EJB context. For that I created this scheduler class: @DependsOn("PoolingHttpClientConnectionManager") ...
WesternGun's user avatar
  • 13.1k
0 votes
1 answer
64 views

I am trying to follow https://developers.google.com/identity/protocols/oauth2/web-server#exchange-authorization-code to exchange a code for an access token. I am able to get my local endpoint to ...
HeronAlgoSearch's user avatar
-1 votes
1 answer
233 views

I'm trying to connect to an endpoint using Apache's HttpClient 4.5, and am running into the below exception: DEBUG [main] (RequestAddCookies) - CookieSpec selected: default DEBUG [main] (...
quantumferret's user avatar
1 vote
0 answers
849 views

We are trying to upgrade the httpclient from 4 to 5. As a part of the upgrade, we have changed the imports accordingly. But, the code uses Httpclientbuilder and sets the sslcontext. As per the ...
kengi ortega's user avatar
0 votes
1 answer
45 views

I am configuring a class to manage an Apache HttpClient that will be used application-wide for the lifetime of the application, like the following: public class HttpManager { private ...
EarthTurtle's user avatar
-3 votes
1 answer
1k views

The following code compiles nicely against Spring-5.x: import org.apache.http.client.HttpClient; ... private static ClientHttpRequestFactory clientHttpRequestFactory( int timeOut) throws ...
Mikhail T.'s user avatar
  • 4,266
0 votes
1 answer
734 views

With Apache Http client 5.1.x, I want to set timeout on every HTTP request(Get, Post, ..), as I don't want to wait for more than certain period for obvious reasons. But I'm confused mostly between ...
Swanand's user avatar
  • 131
0 votes
0 answers
35 views

We have deployed our code in AWS lambda. I am using EntityUtils to get string response body. But it gets timeout for big json response string. Total characters in json response is 6266832 String ...
vishal's user avatar
  • 319
0 votes
3 answers
541 views

I have set up PoolingHttpClientConnectionManager (with ssl): private PoolingHttpClientConnectionManager getConnManager( Registry<ConnectionSocketFactory> socketFactoryRegistry) { ...
Tomas Secret's user avatar
0 votes
1 answer
1k views

I still use Apache Http Client 4. But, I would like to set the Bearer Token just before making a request. Then, I have tried the following public class Test { public static void main(final String[]...
Suzuki Yuu's user avatar
1 vote
0 answers
468 views

I have a Apache Async Http client which I use to connect to IP addresses (instead of domain name). I want to find a way to provide the SNI information, something like this so that the SSL handshake ...
abs060's user avatar
  • 9
0 votes
1 answer
385 views

WSO2 APIM Server : 4.1.0 OpenJDK : 64-Bit Server VM (11.0.17+8-LTS mixed mode, sharing) Linux : RHEL 8.x CPU/Processor : 4 Memory : 8GB WSO2 APIM 4.1.0 running on OpenJDK 11 continues to shows 100% ...
anuu_online's user avatar
0 votes
1 answer
237 views

I am migrating to apache httpclient5 from apache httpclint 4. I use the Zero Copy Get request process as follows. https://svn.apache.org/viewvc/httpcomponents/httpasyncclient/branches/4.1.x/...
Suzuki Yuu's user avatar
0 votes
0 answers
62 views

I'm working on some Java 8 code (using Apache httpclient 4.3) to process out the content from an HTTP response. I am able to print out the content but on the last iteration of the while loop after the ...
Trevor Pastrami's user avatar
1 vote
1 answer
743 views

I am updating an old project's dependencies. One of the transitive changes pulled in is a version bump of apache-httpclient from 4.5 to 5.2. This project implements the recommended ...
Patrick M's user avatar
  • 11k
0 votes
0 answers
35 views

RFC spec states Http headers are case-insensitive: Are HTTP headers case-sensitive? In our source code we set headers in [org.apache.hc.core5.http.HttpMessage](https://github.com/apache/httpcomponents-...
Jae Lee's user avatar
0 votes
1 answer
3k views

I want to migrate this apache http client code: import org.apache.http.conn.HttpClientConnectionManager; import org.apache.http.conn.ssl.SSLConnectionSocketFactory; import org.apache.http.impl.client....
Peter Penzov's user avatar
  • 1,104
0 votes
1 answer
466 views

I was migrating the usage of apache httpclient 4.x to httpclient 5.x version and there a lot of changes in the classes and methods. This particular question is about setRelativeRedirectsAllowed() ...
authorizeduser's user avatar
0 votes
1 answer
353 views

I want to write unit test for a method which uses Apache Http to fetch data. public UserResponse getUserById(String id) { UserResponse userResponse; String jwtToken = SecurityUtil.getAuthToken(...
Abhimanyu Patil's user avatar
3 votes
1 answer
236 views

"Serverless" infrastructure like AWS lambda makes use of Coordinated Restore at Checkpoint to improve startup time of java programs. AWS documentation states that The state of connections ...
peterulb's user avatar
  • 3,053
4 votes
2 answers
5k views

We're upgrading from Apache HttpClient 4.5 to 5.2, and it seems there's been a significant change to how the pool timeout works. We want the pool configured so it has some fixed number of connections ...
shmosel's user avatar
  • 51k
-1 votes
1 answer
314 views

I am trying to configure persistent HTTP caching using the org.apache.http.impl.client.cache.CachingHttpClients builder. However, when I configure a cache directory, the cache never seems to be read ...
Safron's user avatar
  • 880
2 votes
2 answers
8k views

We are using QuotaGuard proxy to connect with external API. Recently we did Spring Boot version update. Technical configuration of our application. Before Spring Boot version update. Java 8 Spring ...
Monirul Islam's user avatar
0 votes
1 answer
1k views

When using Feign, it defaults to using HttpURLConnection. I anticipated performance improvements by switching to Apache HttpClient for connection pooling. However, in my tests, the response time ...
katie8910's user avatar
0 votes
1 answer
275 views

I use the apache http client library (4.5.14). I'm doing a request which receives a 302 along with a Location response header. The Location response header is URL encoded, but somehow the apache http ...
sbrattla's user avatar
  • 5,426
0 votes
1 answer
125 views

Example code: public static void main(String[] args) throws Exception { RequestConfig requestConfig = RequestConfig.custom() .setConnectTimeout(1_000) .setSocketTimeout(...
Dasmowenator's user avatar
  • 5,528
0 votes
1 answer
841 views

I have some custom logging logic that logs information from the request and response. Some log lines contain information from both the request and the response at the same time. Thus, I somehow need ...
Miss Skooter's user avatar
0 votes
1 answer
184 views

I have a small application used to Test connectivity over https. I am using the Apache HttpClient 4.5 to create a HttpClient and invoking a HttpGet call. This works fine for IPv4 but when I try to ...
Suman Mummaneni's user avatar
1 vote
1 answer
487 views

in our Spring Boot application we are using actuator and integrated prometheus. Now we would like to gather HTTP client metrics. In our scenario we are using OpenAPI specification for defining the ...
Chris Brown's user avatar
0 votes
0 answers
288 views

I'm trying to implement some unit tests for my HttpClient (in Scala 2.11); Here's my client: import org.apache.http.client.methods.HttpPost import org.apache.http.impl.client.HttpClientBuilder import ...
fricadelle's user avatar
1 vote
1 answer
240 views

I want to make a Multipart request to my server from java using the apache CloseableHttpAsyncClient, this is what i currently have: File file = new File("pathname"); MultipartEntityBuilder ...
Alessandro Valentino's user avatar
0 votes
0 answers
77 views

I have a problem with my spring boot application. I have a rest controller that sends some http request by apache httpclient. So when I load 1000 req/s to my controller I get answer after 1ms (in ...
Haster's user avatar
  • 187
0 votes
0 answers
669 views

I'm currently developing an application using Java 11 and Spring Boot. Within this application, I make calls to two external REST APIs using the RestTemplate library. Below, you'll find the ...
Somnath Mukherjee's user avatar
0 votes
1 answer
3k views

I've been able to build and run the example code (from Alain O'Dea) in this older SO thread: How do I pass the client certificate with HTTP client? As described in that thread, I downloaded the 4 JAR ...
jstack100's user avatar
  • 1,396
0 votes
0 answers
969 views

Why I'm getting this error, while the host I'd like to establish the ssl connection with matches the wildcard from the Alternative names field of the certificate? We use <dependency> ...
Eljah's user avatar
  • 5,423
0 votes
1 answer
524 views

Recently I migrated from Apache Commons Http Client 3.x to the new Apache 4.x http client. Everything was replaced like Multithreaded Http Client Connection Manager to PoolingHttpClientManager. ...
Harsha Vardhan Sai T's user avatar
0 votes
0 answers
689 views

I am using opensearch-java client to connect to my OpenSearch cluster hosted in AWS. The client uses Apache HttpClient5 Transport to connect to the cluster. This is how my client is setup: protected ...
contemplator's user avatar
0 votes
2 answers
330 views

I'm using Apache HttpClient 4.5 and I want to configure the connection pool to limit the number of waiting threads. So if the pool is exhausted, it should allow up to n threads to wait for a ...
shmosel's user avatar
  • 51k
0 votes
1 answer
381 views

I have created one HTTP Post request with Basic authentication using httpclient (org.apache.httpcomponents). CredentialsProvider provider = new BasicCredentialsProvider(); provider....
Rasel's user avatar
  • 870
1 vote
1 answer
12k views

I am utilizing HTTPclient4 in Java to send HTTP requests and handle HTTP responses. I want to use connectionPooling for improved performance but I am not able to find a proper way to do it. I am ...
ketan's user avatar
  • 75
0 votes
0 answers
515 views

I am posting JSON Payload to REST API by using PATCH method with the help of apache http client libraries Java Version: 1.8.0_171 Following this link for PATCH method with apache http client Code ...
Justin's user avatar
  • 987

1
2 3 4 5
47