[plt-scheme] Problem fetching a URL

From: David T. Pierson (dtp at mindstory.com)
Date: Thu Oct 12 00:21:33 EDT 2006

I think the discussion here is missing a more fundamental point.  The
data in the query component of an http url should only be interpreted on
the server side.  A client-side application should not try to parse the
data within the query component, and in general there is no reason for a
client to do any such sub-parsing of the query string.  RFC 2396
<http://www.ietf.org/rfc/rfc2396.txt> makes this clear in section 3.4:

 3.4. Query Component
    The query component is a string of information to be interpreted
    by the resource.  ...

RFC 2396 has actually been made obsolete by RFC 3986
<http://www.ietf.org/rfc/rfc3986.txt>.  Unfortunately 3986 does not
include the above wording and is therefore somewhat less clear on this
point.  For the record, it states:

  3.4.  Query
    The query component contains non-hierarchical data that, along with
    data in the path component (Section 3.3), serves to identify a
    resource within the scope of the URI's scheme and naming authority
    (if any). ...

The previous references in this discussion to HTML specs and
application/x-www-form-urlencoded are only relevant when encoding or
decoding form data.  While many web applications decode query strings in
this way, they are not required to do so.  An ancient and admittedly
extremely rare example of this is isindex queries
<http://www.w3.org/TR/html401/interact/forms.html#h-17.8>, which would
use the entire query string as a single value.  I've known other
applications which interpret the query string differently too.  A common
example is redirect scripts which treat the whole query string as a url
to which the client should be redirected.

I think the solution for PLT Scheme requires that url parsing never try
to interpret the data within a query string.  (Or at least it shouldn't
do so by default.)  The query field of the url struct should therefore
be a string, not a list of name value pairs.  PLT Scheme applications
which need to encode/decode a query string as
application/x-www-form-urlencoded data can do so using the functions
already provided for that purpose (alist->form-urlencoded and


Posted on the users mailing list.