You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by "Karr, David" <Da...@wamu.net> on 2003/05/02 20:28:07 UTC

[httpclient] Process for posting request parameters through authenticated proxy

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 the
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()", passing
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.