hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From smith jack <thinke...@gmail.com>
Subject How to set the parameters if i want to use HttpPost
Date Sat, 16 Jul 2011 07:57:59 GMT
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    -_____-

---------------------------------------------------------------------
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