On Mon, 2005-10-31 at 14:26 +0000, kunal ashar wrote:
>  Hi,
> 
>  
> 
> In new HTTP commons-httpclient-3.0-rc4, how can we send the message with one 
> parameter (string data) using PostMethod API?
> 
>  
> 
> In httpclient-2.0.2 we have a method called setRequestBody (String) of 
> PostMethod. In version 3.0, this method has been deprecated
> 
>  
> 
> In 3.0 setRequestBody method accepts only Name Value pair. How can we send 
> only string data with out using Name Value pair?
> 

This should do the trick:

PostMethod httppost = new PostMethod("/target");
httppost.setRequestEntity(new StringRequestEntity("stuff"));

Oleg

>  
> 
> Thanks
> 
> Ashar
> 
>  
> 
> 
>               
> ---------------------------------
> To help you stay safe and secure online, we've developed the all new Yahoo! 
> Security Centre.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to