Hi All,

I am having a strange issue while using HttpPost method.

I am using HttpPostMehod to send a Http Post request to an external server. My servlet is just proxy to the external server.

My code is something like this.


HttpServletRequest request

HttpClient client = new HttpClient();
PostMethod post = new PostMethod(url);

post.setRequestEntity(new InputStreamRequestEntity(request.getInputStream());

This work perfectly file.

But if I read any request parameter from the request before executing the request, even If I don't 
do any thing else with the request and irrespective of the parameter existing or not. I just add 
this line before executing the post request "request.getParameter("xyz")".
The Post request fails with the addition of this line . I get Response code of 
400 from the external server.

I don't not have access to the external server, so I can't see what might be wrong. But this is quite strange behavior. I need access the above said request parameter in my servlet for some validation.

Could anybody suggest what might be going wrong or if there is something I am doing wrong ?

Any help is much appreciated.

regards,
Mukesh

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

Reply via email to