Top "Apache-httpclient-4.x" questions

A Java HTTP client library.

HttpClient get status code

Using Apache HttpClient 4.1.3 and trying to get the status code from an HttpGet: HttpClient client = new DefaultHttpClient(); HttpGet response = new …

java apache-httpclient-4.x
Why am I getting an exception javax.net.ssl.SSLPeerUnverifiedException: peer not authenticated?

I'm using Apache HttpComponents HttpClient(4.0.1) to make a HTTPS call, but I'm this exception as the response: javax.net.ssl.…

java ssl https apache-httpclient-4.x
Apache HttpClient (4.1 and newer): how to do basic authentication?

How do I add basic authentication for the default client of the httpClient library? I have seen examples where they …

java apache-httpclient-4.x apache-httpcomponents
java.net.SocketException: Too many open files

I have a java app which runs just fine (on Ubuntu 10.04) for few hours until it hits "java.net.SocketException: …

java apache-httpclient-4.x
How do I use an SSL client certificate with Apache HttpClient?

In Python I was using requests like this: requests.put( webdavURL, auth=(tUsername, tPassword), data=webdavFpb, verify=False, cert=("/path/…

java apache-httpclient-4.x
javax.net.ssl.SSLPeerUnverifiedException: Host name does not match the certificate subject provided by the peer

I follow many links on stackoverflow and tried many solutions, but none of them worked for me. I'm using WSO2 …

java ssl ssl-certificate apache-httpclient-4.x wso2-am
How to add parameters to all HttpClient request methods?

I am writing some Java code that uses Apache HttpClient version 4.2.2 to hit a RESTful 3rd party API. This API …

java http rest apache-httpclient-4.x
How to set custom User-Agent with apache http client library 4.1?

How to make HTTPClient use custom User-Agent header? The following code submits empty user-agent. What am I missing? import java.…

java user-agent apache-httpclient-4.x
Apache HttpClient timeout

Is there a way to specify a timeout for the whole execution of HttpClient? I have tried the following: httpClient.…

java timeout apache-httpclient-4.x
Mocking Apache HTTPClient using Mockito

I'm trying to mock Apache HttpClient Interface in order to mock one of its methods mentioned below to return a …

java mocking mockito apache-httpclient-4.x