hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rmillet <rmillet42+apa...@gmail.com>
Subject DecompressingHttpClient and POST requests
Date Thu, 31 May 2012 08:48:32 GMT
Hi,

I want to replace the deprecated ContentEncodingHttpClient with
DecompressingHttpClient, but the DecompressingHttpClient don't send the
body of the Post request.
(If I use the DefaultHttpClient without the DecompressingHttpClient, the
request sent contains the body and the Content-Type header)


Here is what I do:

            HttpClient client = new DecompressingHttpClient(new
DefaultHttpClient());

            HttpPost request = new HttpPost(new URI("http://tests/post.php
"));
            List<NameValuePair> parameters = new ArrayList<NameValuePair>();
            parameters.add(new BasicNameValuePair("toto", "42"));
            request.setEntity(new UrlEncodedFormEntity(parameters,
Consts.UTF_8));

            client.execute(request);


What is the working fashion to send post requests with
DecompressingHttpClient ?


Regards,
rmillet

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message