You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by h2ooo x <tj...@hotmail.com> on 2004/10/13 10:26:11 UTC

[HttpClient] Set params in GetMethod?

Here is the Http form,

  <form action="./FT_index.php" method="get" name="myForm">
    <input type="HIDDEN name="lang" value="1">
    <input name="submit" type="submit" value="OK">
  </form>

Usually we can use PostMethod.setRequestBody() to set the parameter like 
"lang". Unfortunately, I cannnot find the similar method in GetMethod. How 
can I set the "lang" parameter?

_________________________________________________________________
Download ringtones, logos and picture messages from MSN Malaysia 
http://www.msn.com.my/mobile/ringtones/default.asp


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


Re: [HttpClient] Set params in GetMethod?

Posted by Oleg Kalnichevski <ol...@bluewin.ch>.
HttpMethod#setQueryString(NameValuePair[]) should do the trick

http://jakarta.apache.org/commons/httpclient/apidocs/org/apache/commons/httpclient/HttpMethod.html#setQueryString(org.apache.commons.httpclient.NameValuePair[])

Oleg

On Wed, 2004-10-13 at 10:26, h2ooo x wrote:
> Here is the Http form,
> 
>   <form action="./FT_index.php" method="get" name="myForm">
>     <input type="HIDDEN name="lang" value="1">
>     <input name="submit" type="submit" value="OK">
>   </form>
> 
> Usually we can use PostMethod.setRequestBody() to set the parameter like 
> "lang". Unfortunately, I cannnot find the similar method in GetMethod. How 
> can I set the "lang" parameter?
> 
> _________________________________________________________________
> Download ringtones, logos and picture messages from MSN Malaysia 
> http://www.msn.com.my/mobile/ringtones/default.asp
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-user-help@jakarta.apache.org
> 


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