hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Paul Philion" <phil...@acmerocket.com>
Subject Re: Post Method
Date Wed, 11 Jun 2003 03:41:20 GMT
In theory I agree, but I see a lot of uses of the O'Reilly multipart stuff,
which expects "multipart/form-data" (see:
http://www.servlets.com/cos/javadoc/com/oreilly/servlet/multipart/MultipartParser.html)

I had a specific problem with the and x-www-form-urlencoded last week, which
is why I'm using PostMethod instead of the multipart version.

What I would really like to see is the ability to set an encoding for a POST
method, and have the data be correctly encoded when the method is executed.
At very least, it would be nice to be able to set the encoding and enforce
the encoding myself when adding the name/values.

----
Paul Philion
philion@acmerocket.com

----- Original Message ----- 
From: "Michael Becke" <becke@u.washington.edu>
To: "Commons HttpClient Project" <commons-httpclient-dev@jakarta.apache.org>
Sent: Tuesday, June 10, 2003 10:29 PM
Subject: Re: Post Method


> There seems to be quite a bit of discussion regarding this question but
> not too much that seems ultimately definitive.  This one seems to be
> the best:
>
> http://groups.google.com/groups?oi=djq&selm=an_537840002
>
> Essentially the author says that form encoding and URI encoding are two
> unrelated things.  When posting via a form the data should be encoded
> as per (http://www.w3.org/MarkUp/html-spec/html-spec_8.html#SEC8.2.1).
> When building a URI rfc2396 should be used.
>
> If this is correct, which I think it is, PostMethod is incorrectly
> encoding values.  It also seems that query parameters are being
> incorrectly encoded as they should be using x-www-form-urlencoded. My
> guess is that most web servers will accept data encoded either way as
> there is some general confusion regarding this.  My feeling is that
> PostMethod and HttpMethodBase should be changed to conform to the
> x-www-form-urlencoded standard.  What does everyone think?
>
> Mike
>
> On Tuesday, June 10, 2003, at 01:13 PM, Mike Moran wrote:
>
> > Michael Becke wrote:
> >> I think there may be a bug here as well.  According to the spec,
> >> space characters should be represented as '+' but URIUtil is encoding
> >> them as '%20'.  I think the resevered character set is perhaps also
> >> incorrect. According to rfc 1738 ";", "/", "?", ":", "@", "=" and "&"
> >> are the reserved chars but URI is also uncluding "+", "$" and ",".
> >> My guess is that most servers translate all hex encoded characters
> >> but it seems that we are not quite to spec.
> >
> > You may want to double-check this with rfc2396, which updates rfc1738.
> > My interpretation of the '+'/'%20' issue was that both were legal
> > escapings of space, however it may be worth another reading on my >
part.
> >
> > -- 
> > Mike Moran
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> > commons-httpclient-dev-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail:
> > commons-httpclient-dev-help@jakarta.apache.org
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
commons-httpclient-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail:
commons-httpclient-dev-help@jakarta.apache.org
>
>


Mime
View raw message