Laura,

After looking into this some more I agree that query parameters should be form urlencoded. The query param=value convention is an HTML specification and has nothing to do with URIs. Fortunately it turns out that form urlencoded values conform to the specification for URI queries.

While investigating this question I discovered something else about form urlencoding that is strange. It seems that the characters *, -, _ and . are not encoded by browsers (IE, Mozilla and Safari). I am not sure why this is from reading the spec but it seems fairly consistent. I am also wondering why we are not using the java.net.URLEncoder for this (is also does not encode *-_.).

I propose that we:

- form urlencode values passed to HttpMethodBase.setQueryString(NameValuePair[])
- use java.net.URLEncoder for form urlencoding


Any thoughts, objections?

Mike

On Friday, June 20, 2003, at 06:05 PM, Laura Werner wrote:

Michael Becke wrote:

Yes, but this is for application/x-www-form-urlencoded values. Currently we only assume this content type for post params (this was recently fixed).

I think we have to assume it for get params too. In the HTTP 4.01 spec, 17.13.3.4 <http://www.w3.org/TR/html4/interact/forms.html#h-17.13.3.4>:


If the method is "get" and the action is an HTTP URI, the user agent takes the value of action, appends a `?' to it, then appends the form data set, encoded using the "application/x-www-form-urlencoded" content type. The user agent then traverses the link to this URI. In this scenario, form data are restricted to ASCII codes.

So urlencoded seems like the right default for "get" query parameters.


-- Laura

BTW, how do you all feel about newsgroup posts in HTML format? I left this one in HTML because of all the links, but I'll stop if any of you have news readers that can't deal with it.



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




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



Reply via email to