Questions tagged [apache-commons-httpclient]

The HttpClient v3.x (or older) library from the Apache Commons project

For questions releated to the newer Apache HttpClient v4.x library, see

536 questions
15
votes
4 answers

Apache HttpClient Digest authentication

Basically what I need to do is to perform digest authentication. First thing I tried is the official example available here. But when I try to execute it(with some small changes, Post instead of the the Get method) I get…
Milan
  • 900
  • 2
  • 14
  • 25
15
votes
4 answers

How can I disable default request headers from apache httpclient 4?

I am using apache common httpclient 4.3.3 to make http 1.0 request. Here is how I make the request HttpClient client = HttpClientBuilder.create().build(); HttpPost post = new HttpPost(url); post.setProtocolVersion(new ProtocolVersion("HTTP", 1,…
Sean Nguyen
  • 12,528
  • 22
  • 74
  • 113
14
votes
4 answers

Ignore self-signed certificates in Apache HTTPClient 4.5

I am trying to accept all certificates, and/or accept self-signed certificates using Apache HTTPClient version 4.5 (tutorial link here) I've been going through solutions to this problem from a bunch of posts on SO. So far none of them have worked.…
Katie
  • 45,622
  • 19
  • 93
  • 125
14
votes
1 answer

How can I reuse a HttpClient connection efficiently?

I am doing HTTP POSTs very frequently (>= 1/sec) to an API endpoint and I want to make sure I'm doing it efficiently. My goal is to succeed or fail as soon as possible, especially since I have separate code to retry failed POSTs. There is a nice…
pr1001
  • 21,727
  • 17
  • 79
  • 125
14
votes
1 answer

How to make HttpClient use Kerberos?

HttpClient is a Java library to browse websites. I want to use it with Kerberos. The Kerberos part of HttpClient's documentation mostly says: The best way to start is to grab the KerberosHttpClient.java file in examples and try and get it to…
Nicolas Raoul
  • 58,567
  • 58
  • 222
  • 373
13
votes
2 answers

Angular 6 set withCredentials to true with every HttpClient call

If you want the credentials (cookie authentication token) to be passable through a call, you need to add { withCredentials: true } in your httpclient call. Something like this: import { HttpClient } from…
Freddy Bonda
  • 1,189
  • 6
  • 15
  • 33
12
votes
4 answers

How can I override the "Host" header in the request when using Apache commons HttpClient

I am using Jakarta Commons HttpClient 3.1 writing a load test tool that needs to target different servers and pretend like it targeted the correct virtual host in the HTTP server. For that I need to be able to set the "Host" HTTP header in the…
Guss
  • 30,470
  • 17
  • 104
  • 128
12
votes
5 answers

Cannot process url with vertical/pipe bar in Java/Apache HttpClient

If I want to process this url for example: post = new HttpPost("http://testurl.com/lists/lprocess?action=LoadList|401814|1"); Java/Apache won't let me because it says that the vertical bar ("|") is illegal. escaping it with double slashes doesn't…
11
votes
4 answers

Converting from HttpClient 3 to 4

I've managed to make changes to everything but the following: HttpClient client; HttpPost method; client = new DefaultHttpClient(); method = new HttpPost(url); InputStream rstream; try { rstream = method.getResponseBodyAsStream(); } catch…
Jenny
  • 251
  • 2
  • 7
  • 14
10
votes
3 answers

Problems using the EWS Java API on Android

I am trying to use the EWS Java API v1.1.5 (http://archive.msdn.microsoft.com/ewsjavaapi) in an Android application, and have run into a number of issues. I downloaded the source, and followed the instructions provided to compile the EWS Java API in…
10
votes
2 answers

Why IntelliJ IDEA doesn't see HttpClients?

I've added following into dependencies section of my pom.xml: org.apache.httpcomponents httpclient 4.4.1 test
Budda
  • 18,015
  • 33
  • 124
  • 206
10
votes
2 answers

How to stream response body with apache HttpClient

There's an api I need to perform octet-streaming from which does not have a length. It is just a stream of real time data. The issue that I'm having is that when I make my request, it seems to try to wait out for the end of the content before…
10
votes
2 answers

How do I get the cookies from Apache HttpClient 4.x?

How do I get the cookies from an existing object of type HttpClient? I'm using HttpClient version 4.3.3 which has no method httpClient.getCookieStore() anymore.
eztam
  • 3,443
  • 7
  • 36
  • 54
10
votes
2 answers

How do I pass the client certificate with HTTP client?

I want to use mutual SSL authentication between service A and B. I'm currently implementing passing the client certificate from service A in Java. I'm using Apache DefaultHttpClient to execute my requests. I was able to retrieve the client…
agerrr
  • 1,253
  • 5
  • 14
  • 24
9
votes
1 answer

Jax-WS Axis2 Proxy over SSL error using ProxySelector

In my project I have the following project structure: I have a module that is producing a war file and can be deployed inside a Tomcat application server. This module has dependencies on Axis2 libraries:
Mathias G.
  • 4,875
  • 3
  • 39
  • 60
1 2
3
35 36