hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "KARR, DAVID (ATTSI)" <dk0...@att.com>
Subject RE: Do I need to add POST params to a UrlEncodedFormEntity, or can I add them to the params in the HttpPost?
Date Fri, 20 May 2011 16:27:31 GMT
> -----Original Message-----
> From: Oleg Kalnichevski [mailto:olegk@apache.org]
> Sent: Friday, May 20, 2011 9:20 AM
> To: HttpClient User Discussion
> Subject: Re: Do I need to add POST params to a UrlEncodedFormEntity, or
> can I add them to the params in the HttpPost?
> 
> On Thu, 2011-05-19 at 23:42 +0000, KARR, DAVID (ATTSI) wrote:
> > I have some code using HttpClient 4.1.1 that is doing a POST, and it
> appears to be working.  It's adding a couple POST parameters to the
> params property on the HttpPost.  After I had this working for a while,
> I noticed that examples using HttpClient to send POSTs always create a
> UrlEncodedFormEntity and add the params to that, instead of what I'm
> doing.  Is there any reason I shouldn't be adding the POST parameters
> directly to the params object on the HttpPost instance?
> >
> 
> http://hc.apache.org/httpcomponents-client-
> ga/tutorial/html/fundamentals.html#d4e310
> http://hc.apache.org/httpcomponents-client-
> ga/tutorial/html/fundamentals.html#d4e191

Yes, I've already read those.  It doesn't tell me why my existing code is working.

After more experimentation, I've realized that the existing seemingly broken code is only
working in the 3.0.1 implementation.  It "correctly" fails in the 4.1.1 implementation. Once
I added the proper use of UrlEncodedFormEntity, my 4.1.1 test case is working again.

Mime
View raw message