You are viewing a plain text version of this content. The canonical link for it is here.
Posted to httpclient-users@hc.apache.org by Ramit Bhardwaj <ra...@cybage.com> on 2006/02/01 16:25:10 UTC

Request parameters not getting set

Hi guys,
 
I am using HTTPcommons client  2.0.2 version. My goal is to send a binary data to a servlet and also a request parameter (similar to request.setAttribute in servlets). i am 
doing postMethod.addParameter("key","value") and then post.setRequestBody(binary-stream).
 
I m getting the binary data but i am not getting the value which i set using addParameter...what could be the reason..is my approach correct ...how do i achieve my goal
 

Regards 



Re: Request parameters not getting set

Posted by Oleg Kalnichevski <ol...@apache.org>.
On Wed, 2006-02-01 at 20:55 +0530, Ramit Bhardwaj wrote: 
> Hi guys,
>  
> I am using HTTPcommons client  2.0.2 version. My goal is to send a binary data to a servlet and also a request parameter (similar to request.setAttribute in servlets). i am 
> doing postMethod.addParameter("key","value") and then post.setRequestBody(binary-stream).
>  
> I m getting the binary data but i am not getting the value which i set using addParameter...what could be the reason..is my approach correct ...how do i achieve my goal
>  

Ramit,

Form parameters always get overwritten by the post.setRequestBody method
because they are transmitted in the request body. Use URL query
parameters instead.

Oleg

> 
> Regards 
> 
> 


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