>>> Gokul Singh <[EMAIL PROTECTED]> 03-Dec-00 7:26:42 AM >>>
>I am using a query string in the url with my post requests.
>I access it using getQueryString() and parse it with
>HttpUtils.parseQueryString() method.
>It works when I do not use a proxy server. But this seems
>to fail when access it using HttpURLConnection with proxy.
>Can someone please tell me if what I am trying to achieve is
>wrong or it is a bug in HttpURLConnection.
I *think* there is an architectural bug in HttpURLConnection that
stops POSTs from the class being legal.
I know that Kaffe's version and Classpath's version (the GNU portable
javalib) cannot handle a POST properly (because of the architectural
problems with the class). I've not seen the SUN code so I can't
confirm it but I suspect there code has it to...
The problem is that the request properties have to be set statically,
like this:
void HttpURLConnection.connect()
{
.
.
.
out.println("Host: "+properties.get("host");
out.println("UA: "+properties.get("ua");
This is necessary because of various reasons that I won't go into
now... but the trouble is it means that a content-length doesn't get
written, even if you specify it.
Most servlet engines (in fact most of anything) can't handle a POST
unless there is an associated content-length to tell the engine when
the data is finished.
I'm trying to come up with a solution to this for Kaffe and Classpath
but the real answer is to get Sun to change the spec of these
dreadfull classes (the URLConnections).
Nic
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html