hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael Becke <be...@u.washington.edu>
Subject Re: Post parameter arrays !!
Date Wed, 19 Jan 2005 13:34:35 GMT
Hi Eric,

There is no need to set this header.  The PostMethod will take care of 
this for you when you set the post content using one of the 
*Parameter() methods or setRequestBody(NameValuePair[]).

Mike

On Jan 19, 2005, at 1:35 AM, Eric Chow wrote:

> Hi Julius,
>
> I can't get any setHeader() method in PostMethod !
> How can I add the header ??
>
> Eric
>
>
>
>
>
> On Tue, 18 Jan 2005 18:15:22 -0800, Julius Davies
> <juliusdavies@cucbc.com> wrote:
>> Hi, Eric,
>>
>> In an earlier post I recommend using Mozilla + LiveHttpHeaders plugin 
>> to watch exactly what the browser does.  In this example, the 
>> browser's request looks like:
>>
>> =====================================
>> POST /servlet/mypost HTTP/1.1
>> Content-Type: application/x-www-form-urlencoded
>> Content-Length: 17
>> key=a&key=b&key=c
>>
>> =====================================
>>
>> Does that give you an idea?  Don't forget to add this to your code!
>>
>> method.setHeader( "content-type", "application/x-www-form-urlencoded" 
>> );
>>
>> yours,
>>
>> Julius
>>
>>
>> -----Original Message-----
>> From:   Eric Chow [mailto:eric138@gmail.com]
>> Sent:   Mon 1/17/2005 8:15 PM
>> To:     httpclient-user@jakarta.apache.org
>> Cc:
>> Subject:        Post parameter arrays !!
>> Hello,
>>
>> How can I post an array of parameters ?
>>
>> For example,
>>
>> <form action="/servlet/mypost" method="post">
>>   <input type=text name="key">
>>   <input type=text name="key">
>>  <input type=text name="key">
>> </form>
>>
>> As in the above HTML form, there are three text field with the same 
>> name "key",
>> how can I post this kind of form with HttpClient ??
>>
>> Eric
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: httpclient-user-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail: 
>> httpclient-user-help@jakarta.apache.org
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: httpclient-user-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail: 
>> httpclient-user-help@jakarta.apache.org
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: httpclient-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: 
> httpclient-user-help@jakarta.apache.org
>


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


Mime
View raw message