Questions tagged [apache-httpclient-4.x]

A Java HTTP client library. Supersedes the Commons HttpClient project.

0
votes
0answers
9 views

Amazon Secrets Manager, Java 7, and CipherSuites

I am trying to get AWS Secrets Manager to work on an older Java 7 platform. Unfortunately we're locked on Java 7 for now. The issue I have is that Java 7 had some security issues with SSL, and most ...
0
votes
1answer
43 views

wget returns 200/OK while org.apache.http.impl.client.CloseableHttpClient returns 404/NOT_FOUND

I'm trying to read this URL ( "https://www.encodeproject.org/files/ENCFF784GFP/@@download/ENCFF784GFP.hic" ) using http-components/java. It works fine with wget: wget -S -q -O - "https://www....
1
vote
3answers
43 views

Apache HttpClient Connection Management

I'm trying to understand the best approach to manage http connections using Apache HttpClient in an implementation (not mine). I think the way it is implemented right now is a waste, but since I'm not ...
0
votes
0answers
6 views

DefaultClientConnectionOperator : java.lang.NoSuchMethodError

Getting some dependency management issue due to which getting following exception. Caused by: java.lang.NoSuchMethodError: org.apache.http.impl.conn.DefaultClientConnectionOperator.<init>(Lorg/...
-4
votes
0answers
14 views

Apache httpclient code equivalent of this curl code

curl --anyauth -u username:password -d '{"port":[0]}' -H "Content-Type: application/json" http://gateway_ip/api/get_cdr
1
vote
0answers
34 views

Spark Local gets better performance than Cluster Mode

I'm currently using Spark with DataFrames to make a series of HTTP GET requests for each Row. I'm currently using the Apache HttpClient 4.5.x dependency to make the GET requests. I've noticed that ...
0
votes
0answers
5 views

http.connection=CPoolProxy{detached} after EntityUtils.toString(httpResponse.getEntity());

I am running into a weird issue using apache HTTPClient (httpclient-4.5.1.jar). We have Proxy setup and when I execute the HTTP POST to /xsad/ewer request using CloseableHttpClient's execute() method ...
0
votes
1answer
24 views

What does UrlEncodedFormEntity do in Apache HttpClient 4?

If you want to do an HTTP Post with parameters and have it be sent with a content type of "x-www-form-urlencoded" then the way to do that in Apache HTTP Client 3 is... HttpMethod method = new ...
0
votes
1answer
31 views

Connection reset - Java (underlying socket status remain established) Azure VM

I am debugging one problem of connection reset and need some help. Here is the background Using java version 8, apache httpClient 4.5.2 I have a following program, which runs successfully on ...
0
votes
1answer
23 views

Multipart Post request in Apache Httpclient 4.5.6 not working

I am trying to upload a file to the server. The request is working fine while using Postman tool. In Postman I have : POST :https://transport-stg.transperfect.com/api/files/upload?filename=test.png&...
0
votes
1answer
17 views

Issues exposing Http Client logs with Log4j2

Problems exposing HTTP client logs through Log4j2. I was able to expose the logs with log4j v1, but it's not working with log4j2. Checked the transactive dependencies of http client v4 and it uses ...
0
votes
0answers
15 views

Apache HttpClient 4.5 redirect POST request to GET request

Am traying to hit a post endpoint but It is giving error 302, When I tried another get Url on the same server it gives me 200. Then I redirected the post request using LaxRedirectStrategy() The post ...
0
votes
0answers
15 views

how to fix rest template holding on to old server(https - rest endpoint) cookies?

I have a spring MVC application which calls a 3rd party Rest API (HTTPS) using rest template exchange. This 3rd party rest api returns a specific cookie name region back in the set-cookie header. ...
0
votes
0answers
23 views

The jmeter httpclient4 is causing ephemeral TCP ports exhaustion whereas httpclient3 is not causing in the windows machine

I am running a load test with 600 users using httpclient-3 & httpclient-4 implementation in windows server 2012R2 machine. During the httpclient-4 test after 200 users ramped-up I am facing the ...
1
vote
1answer
42 views

How to use AWSRequestSigningApacheInterceptor with AWS SDK2

I am trying to use REST calls to Neptune SPARQL on existing Java code which already uses Apache HTTP clients. I'd like to not mix and match AWS SDK1 and SDK2 (which I use for the S3 portion of ...
0
votes
0answers
12 views

Unexpected error using Apache HTTP Commons on a Fat Jar

I have a jar running in a proprietary engine that is throwing an unexpected exception. I'm trying to execute the code bellow private void sendRequest(HttpUriRequest request) { try (...
1
vote
1answer
34 views

spirngframework.ws HttpComponentsMessageSender - how to set maximum connectons per any host?

I am migrating from apache httpclients-3.x to 4.x and thus have to update org.springframework.ws.transport.http.CommonsHttpMessageSender to org.springframework.ws.transport.http....
0
votes
0answers
16 views

Jersey Client / Apache connector: how to remove interceptor?

How can I remove request interceptor using Jersey-Client with Apache-Connector? I need to remove default RequestContent interceptor. import org.apache.http.impl.conn....
0
votes
0answers
31 views

Http Connection closed after “end of stream” error from server

We have a service which posts request via soap call to a webserver , sometimes on client side we are receiving end of stream error and apache http connection is getting closed. it is confirmed that ...
1
vote
1answer
33 views

How to add param 'request payload' to post request?

How to create this request from CURL with Jsoup or apache httpClient? curl 'https://www.instagram.com/rupload_igphoto/fb_uploader_1557924189090' -H 'cookie: mid=XNvymQAEAAFb4YRR4JkElxTB8I2_; ...
0
votes
1answer
32 views

How to protect password sending through httpclient method in java

From SCAVA security scan tool it is reported that some of my code lines are subject to vulnerability. The vulnerability classification is : Insufficient_Sensitive_Transport_Layer The vulnerable code ...
0
votes
0answers
14 views

Encode space as %20 in Apache HTTPClient native

I'm using latest Apache HTTPClient currently it encode space as +, Integrating a third party I must encode space as %20 in query and header parameters, otherwise it fails, I found a workaround ...
0
votes
0answers
10 views

Read http request from socket and convert it in to a standard Java Object lilke HttpServletRequest or apach HttpRequest?

I have the complete Http Request as a String, which I read from the Server side of socket connection. I was looking for an API for converting the String http request to a standard HttpRequest java ...
0
votes
1answer
24 views

How to fix URIBuilder getRequest param escaping

in my Code I want to start a GET Request on a SugarCRM REST API V10, for a filter i have to add some parameters to the request what should be: https://domain/rest/v10/Accounts?filter=[{"...
0
votes
0answers
12 views

cannot open the image which download by urlconnection but httpclients

I can open the 1.jpg but can not open the 2.jpg public static void main(String[] args) throws Exception{ download("https://maint1.deeptel.com.cn/upload/M00/00/5B/...
0
votes
2answers
36 views

maven build succeeds, but eclipse build fails

I have an Eclipse / Maven project: The build with Maven succeeds, but Eclipse does have compile-time errors and cannot build. My Eclipse is Neon (4.6.3) and I am using the build-in Maven and JDK 1.8 ...
0
votes
0answers
36 views

How to update metadata for share point document via rest api using JAVA Apache httpclient?

I am trying to update metadata for Share Point library document via rest API using JAVA Apache HTTP client. I am able to get Form Digest Value from SharePoint API context. However receiving error ...
0
votes
1answer
26 views

Closing apache CloseableHttpConnection and properly handle closing exception

According to the Apache documentation, whenever you open a CloseableHttpClient, you must also close it. However, the close method of CloseableHttpClientthrows an IOException. I cannot find any word in ...
0
votes
0answers
19 views

HTML button, apache.http.client. sending post request to it

Long story short I having an issue sending post request to sever, after completing my first one. This is being done in java. Basically my question is using apache http client is it possible to press ...
0
votes
0answers
24 views

Getting HttpResponse statusCode 302 when uses different HttpClient object for Auth and other API calls

I am calling CREATE_USER endpoint of one of the client and it needs CSRFTOKEN so am calling AUTH endpoint of the same client and using that CSRFTOKEN to call CREATE_USER endpoint. So the issue is to ...
1
vote
1answer
28 views

how to upload a file to a public AWS S3 bucket with Java Apache HttpClient

Given: AWS S3 Bucket named YOUR_BACKET_NAME with public access READ/WRITE Need to upload a file to a public S3 bucket. Using only basic most popular Java Libs like Apache HTTP Client lib. Should ...
0
votes
0answers
6 views

DefaultListeningIOReactor does not resumes listening to requests after stopped with linux OS

We are using DefaultListeningIOReactor with nio http server 4.5.5, within our application we have a setting when the number a requests reaches a particular value, we call pause() method on ...
0
votes
1answer
59 views

How to attach apache-httpclient-4.x to axis2 stub

I’ve got a problem with my axis2 soap client app (nonprofessional). I used axis2, because the generated client worked out of the box. The CXF or metro clients are throwing a lot of warnings because of ...
0
votes
0answers
17 views

How to handle external api retry call in spark streaming

I have one event enrichment spark job in which I am calling several external APIs(GET and POST requests). It is working fine but I have a problem when request fails due to some exception sometimes ...
0
votes
1answer
26 views

How to POST NON-JSON request using Apache HttpClient?

I am to hitting an API which will return string data and as well I want to send data of string type(textfile in a paragraph).
0
votes
0answers
34 views

HttpComponentsClientHttpRequestFactory in Spring 3.0

Good day, In my java web application, I am trying to create a restTemplate call which go through a proxy first before go for the destination, and I am using Spring 3.0.4. Base on this article, https:...
0
votes
0answers
22 views

How to avoid JVM Memory Leak in application when communicating with more than 1 server? with CloseableHttpClients & continuous CloseableHttpRequests

My Application is making API Calls to 2 different Servers to get Data. So, I have replaced Http Classes by CloseableHttp Classes. Please advice better practise to avoid JVM Memory Leak Issue. @...
0
votes
2answers
67 views

How to encode UTF-8 CloseableHttpClient request

I have a simple POST: String url = "https://mysite"; try (CloseableHttpClient httpClient = HttpClients.custom().build()) { URIBuilder uriBuilder = new URIBuilder(url); HttpPost request = new ...
0
votes
1answer
59 views

Apache HttpClient - keepalive is ignored when using SSL or TLSv1.2

I am using Apache HttpClient 4.5 for my soap webservice. Currently, I have encountered an issue where the keep alive in httpclient is ignored when TLSv1.2 is used. However, the keep alive is working ...
0
votes
1answer
41 views

Http Client Connection fails for large data request [duplicate]

I am using HTTP client to send data to the server using persistent http connections. The data which is approximately 12 MB and is sent on the connect as a byte array on the HTTPRequest. While doing ...
0
votes
1answer
32 views

How to fix NullPointerException trying to instantiate CloseableHttpClient in Jersey 2.x

I have a jersey 2.x web application in which I have a business object that is trying to process a request by calling out to an external service. Whenever I try to instantiate a CloseableHttpClient it ...
0
votes
0answers
13 views

DefaultHttpClient.execute throws ClassCastException

I am working on an Android application which uses DefaultHttpClient. In some devices, when I'm executing a request with my client, the application crashes. This is the exception: E/ExceptionHandler: ...
0
votes
0answers
25 views

How to set TLSv1.2 in SimpleClientHttpRequestFactory

Good day, I am using SimpleClientHttpRequestFactory to do a rest call. The following is part of my code: SimpleClientHttpRequestFactory requestFactory = new SimpleClientHttpRequestFactory( ); Proxy ...
2
votes
0answers
73 views

How to create a trust strategy that accepts only certificates with signed by a public authority?

Currently I have the following piece of code that accepts any SSL certificate (Apache HTTP client 4.5.7): CloseableHttpClient client; final SSLConnectionSocketFactory sf = new ...
0
votes
1answer
19 views

How to remove server/software information from apache http client response

I wrote below sample program to check response of http public class CloseableHttpClientExmpl { public static void main(String[] args) { CloseableHttpClient client =HttpClients.custom(...
0
votes
0answers
12 views

Why does an HttpHostConnectException error occur when calling API with HTTPClient 4.1.x with HttpPost, SSL certificate?

I'm having trouble reading the API with HTTPClient 4.1.x, HttpPost, SSL certificate. When I try to read API with "http" protocol. It's OK. But when I try to read API with "https" protocol. It's not ...
1
vote
1answer
54 views

While trying to send POST request in HTTPCLIENT -JAVA, getting 400 Bad Request

I am trying to POST a request using JAVA HTTPCLIENT, and while doing so, I am getting 404 Bad Request. I tried writing the JAVA code in Eclipse and got 404 Bad Request and tried sending the request ...
1
vote
1answer
96 views

CloseableHttpClient: will all exceptions go to retyHandler() if there's one?

so i'm following this example for retryHandler(), it has the try/finally. My question is: how to do retry for exception ? public class HttpClientRetryHandlerExample { public static void main(...
1
vote
1answer
62 views

How to upload InputStream via HttpPut from Apache HttpClient 4.x

I'm trying to upload an InputStream via HttpPut using the Apache HttpClient 4.5.6: InputStream inputStream = .. CredentialsProvider provider = .. HttpClient client = HttpClientBuilder.create() ...
0
votes
0answers
20 views

How to fetch millions of data records from database and compare or test it with the api(generating same data)

I am an automation tester and having a task to compare data from two input sources a. database and b. API but issue is, The data available is in millions of records. So , please suggest the best ...