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
9
votes
6 answers

How to set proxy host on HttpClient request in Java

I want to set proxy before sending HttpClient request on a URL. As I am able to connect it curl command setting up the proxy but with Java code I am not able to do that. Curl command: **curl -I -x IP:80 URL** Code change done in java…
Developer
  • 6,292
  • 19
  • 55
  • 115
9
votes
3 answers

org.apache.http.entity.FileEntity is deprecated in Android 6 (Marshmallow)

I'm upgrading an app to API 23 where org.apache.http is deprecated. My current (deprecated) code looks like this: HttpClient httpClient = new DefaultHttpClient(); File file = new File(attr.Value); String url = server_url; HttpPost request = new…
8
votes
3 answers

how to handle / read the response with "Transfer-Encoding:chunked"?

May i know how to handle / read the response with "Transfer-Encoding:chunked"? Currently im using common-httpclient.3.1 My current coding as followings (can handle response with content-length in header only) :- httppost = new…
Jacelyn
  • 103
  • 1
  • 1
  • 4
8
votes
2 answers

uploading files to a dataset in CKAN / datahub.io through a Java client

I am testing the uploading of files to a dataset on CKAN / datahub.io through a Java client of the API. public String uploadFile() throws CKANException { String returned_json = this._connection.MultiPartPost("", ""); …
seinecle
  • 10,118
  • 14
  • 61
  • 120
8
votes
2 answers

How can I POST using Java and include parameters and a raw request body?

I am communicating with a web service that expects a POST parameter and also expect Request body. I have confirmed that such a POST request can be done using a REST Console I have, but I am unable to make such a request in Java using Apache…
Data Skeptic
  • 154
  • 1
  • 1
  • 7
8
votes
2 answers

Is it possible to download files like PDF with HttpClient?

I found some examples here on how to download a file but most of them seem to be using HttpURLConnection. is it possible to download files with HttpClient?
124697
  • 22,097
  • 68
  • 188
  • 315
7
votes
3 answers

Kerberos connection using HTTP Client

I'm writing HTTP connection with Kerberos authentication. I have "HTTP/1.1 401 Unauthorized". Could you recommend me what I should check? I think there's somethink trick, but I don't see it. May be I should set header "WWW-Authenticate" with…
7
votes
0 answers

HttpClient5 - Lot of APIs changed / removed

I'm migrating my application to use HttpClient5 but its becoming miserable day by day. Many APIs removed and no proper documentation available to know alternatives. Stackoverflow/any other website/blogs always shows about answers related to…
7
votes
3 answers

How to use DefaultHttpClient in Android?

How to use DefaultHttpClient in Android?
7
votes
4 answers

HttpClient What is the difference between setHeader and addHeader?

When using Apache HttpClient version : org.apache.httpcomponents httpclient 4.5.6 What is the difference between setHeader and addHeader? …
JavaSheriff
  • 7,074
  • 20
  • 89
  • 159
7
votes
1 answer

How does HttpAsyncClient 4 work?

In previous versions of HttpClient target host was set up into client itself. In last version (for HttpAsyncClient it's 4.1.1) host is set up into HttpRequest (HttpGet, HttpPost etc.) every time I do a request. I want to use persistent connection,…
7
votes
3 answers

Logs are filling up with httpclient.wire.content dumps. How can I turn it off?

My catalina logs are filling up with gobs of statements like: /logs/catalina.out:2010-05-05 02:57:19,611 [Thread-19] DEBUG httpclient.wire.content - >>…
user122299
7
votes
2 answers

Confused with different methods of creating cookie in HttpClient

There are different methods to create cookies in HttpClient, I am confused which one is the best. I need to create,retrieve and modify cookies. For example , I can use the following code to see a list of cookies and modify them but how to create…
Tim Norman
  • 421
  • 1
  • 12
  • 31
7
votes
3 answers

HttpClient = INVALID URI - Escaped absolute path not valid

I am trying to upload/delete a file to webdav server using HttpClient. However, none is working whenever I have a file name consist of space . I got a error message saying "INVALID URI--- Escaped absolute path not valid". this my URL =…
david
  • 244
  • 2
  • 4
  • 11
6
votes
3 answers

HttpClient: disabling chunked encoding

I am using the Apache Commons HttpClient along with Restlet to call a restful web service. Unfortunately, my server (based on Ruby on Rails) does not like the Transfer-Encoding: chunked that HttpClient is using by default. Is there any way to…
Thilo-Alexander Ginkel
  • 6,898
  • 10
  • 45
  • 58