hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Oleg Kalnichevski <ol...@apache.org>
Subject Re: How to set the parameters if i want to use HttpPost
Date Sat, 16 Jul 2011 19:05:40 GMT
On Sat, 2011-07-16 at 15:57 +0800, smith jack wrote:
> the httpclient i use is of version 4.0, the document seems to be
> obselete, as a example, i can no longer use the following code now,
> what change i should make in order to use httppost using httpclient
> 4.0
> 
> List<NameValuePair> formparams = new ArrayList<NameValuePair>();
> formparams.add(new BasicNameValuePair("param1", "value1"));
> formparams.add(new BasicNameValuePair("param2", "value2"));
> UrlEncodedFormEntity entity = new UrlEncodedFormEntity(formparams, "UTF-8");
> HttpPost httppost = new HttpPost("http://localhost/handler.do");
> httppost.setEntity(entity);    // HttpPost now has no API named
> setEntity    -_____-
> 


It is still there.

http://hc.apache.org/httpcomponents-client-ga/httpclient/apidocs/org/apache/http/client/methods/HttpPost.html
http://hc.apache.org/httpcomponents-core-ga/httpcore/apidocs/org/apache/http/HttpEntityEnclosingRequest.html#setEntity%28org.apache.http.HttpEntity%29

Oleg


---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
For additional commands, e-mail: httpclient-users-help@hc.apache.org


Mime
View raw message