hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kalnichevski, Oleg" <oleg.kalnichev...@bearingpoint.com>
Subject RE: PostMethod setQueryString
Date Fri, 20 Aug 2004 15:41:17 GMT

Query params are part of the request URL and as such can be used with any HTTP method. A request
body on the other hand can be sent by so called entity enclosing methods only (such as POST
and PUT). PostMethod.setRequestBody(NameValuePair[]) method takes a array of name/value pairs
and constructs a request body out of them using URL encoding. PostMethod.setQueryString(NameValuePair[])
method can be used to pass parameters as a part of the request URL



-----Original Message-----
From: Karthikeyani K [mailto:karthikeyanik@yahoo.com]
Sent: Freitag, 20. August 2004 17:30
To: commons-httpclient-dev@jakarta.apache.org
Subject: PostMethod setQueryString

   What is the difference between invoking setQueryString(NameValuePair[]) and setRequestBody(NameValuePair[])
 on PostMethod.

    When we try to use setQueryString(NameValuePair[]), we are getting the response back.
    But when we try to use setRequestBody(NameValuePair[]), we are getting the response 500.

    Does PostMethod.setQueryString(NameValuePair[]) pass parameters in the requestbody? Is
it similar to PostMethod.setReqeustBody(NameValuePair[]).


Do you Yahoo!?
Win 1 of 4,000 free domain names from Yahoo! Enter now.

The information in this email is confidential and may be legally privileged.  Access to this
email by anyone other than the intended addressee is unauthorized.  If you are not the intended
recipient of this message, any review, disclosure, copying, distribution, retention, or any
action taken or omitted to be taken in reliance on it is prohibited and may be unlawful. 
If you are not the intended recipient, please reply to or forward a copy of this message to
the sender and delete the message, any attachments, and any copies thereof from your system.

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

View raw message