commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Karr, David" <>
Subject RE: [httpclient] Process for posting request parameters through authenticated proxy
Date Fri, 02 May 2003 19:06:56 GMT
I guess I've figured this out.  Creating an array of NameValuePair
objects and sending that array to PostMethod.setRequestBody() appears to
be the way to do this.  My site is still giving me an error, but I think
it's gotten past reading the posted request parameters.

> -----Original Message-----
> From: Karr, David
> I'm trying to massage the "CustomHttpConnection" example to fit my
> situation, which is that I'm trying to POST to a https page through an
> authenticated proxy, sending some request parameters, and then read
> response.
> I appear to have dealt with the proxy and basic connection issues, but
> I'm having trouble figuring out how I'm supposed to send request
> parameters.
> When I connect without trying to send parameters, I'm able to read a
> response from the site that indicates I need to set particular
> parameters.  So, I then tried calling "method.setQueryString()",
> my ampersand-separated parameters.  I didn't bother encoding them,
> because I'm just sending dummy values of simple alpha strings.
> Unfortunately, the response is exactly the same, making it seem as if
> the request parameters were not sent (or they were sent in a form that
> the destination servlet didn't grok, and didn't complain about).
> I also tried calling "getRequestOutputStream()", and writing my
> parameters directly to that stream, but that fails, saying the
> connection is not open.

View raw message