Hi Abhay,

PostMethod.addParameter() and PostMethod.setRequestBody() are mutually
exclusive as they both specify the POST entity and only one can be
used at a time.  If you want to send parameters via the URI query
string please use HttpMethod.setQueryString(NameValuePair[]).

Mike

On 10/7/05, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>
> Hi
>
>
> I want to use PostMethod of commons HTTPClient. The method is used to post
> an XML file and also send some parameters like user id and password. I am
> trying to send the parameters as a part of query string using something
> like this:
>
> postmethod.addParameter("user","username");
>
> and setting the XML content like this:
> postmethod.setRequestBody(requestXML.toString());
>
> I execute the code :
> int statusCode = client.executeMethod(method);
>
> However, the servlet which receives this post request does not get the
> parameters e.g "user". It does get the XML set in the request body.
> Any suggestion why is this happening and any work around?
>
> Abhay Shukla
> Phone# 734-295-6639
>
>
>
> ---------------------------------------------------------------------------
> This message (including any attachments) is confidential and may be
> privileged. If you have received it by mistake please notify the sender by
> return e-mail and delete this message from your system. Any unauthorised
> use or dissemination of this message in whole or in part is strictly
> prohibited. Please note that e-mails are susceptible to change.
> ABN AMRO Bank N.V. (including its group companies) shall not be liable for
> the improper or incomplete transmission of the information contained in
> this communication nor for any delay in its receipt or damage to your
> system. ABN AMRO Bank N.V. (or its group companies) does not guarantee that
> the integrity of this communication has been maintained nor that this
> communication is free of viruses, interceptions or interference.
> ---------------------------------------------------------------------------
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

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

Reply via email to