Xojo Framework HTTPSocket and mal-formed URLs

I’m having a problem that I’m not sure I understand. I’m using the Xojo framework to retrieve a DOI (a unique identifier) from a web source. The DOI is

10.1175/1520-0442(1988)001<0715:COAPSR>2.0.CO;2

I submit it like this (if I enter the URL in a browser it works, btw):

mySocket.send (“GET”, “http://www.crossref.org/guestquery/?queryType=doi&restype=unixref&doi_search=Search&doi=10.1175/1520-0442(1988)001<0715:COAPSR>2.0.CO;2”)

But this generates a “Request url is not well-formed.” exception.

I can perform a EndcodeURLComponent on the DOI, which gets rid of the exception, but the web source doesn’t find the information, saying it’s not a valid id (not a DOI that it can find). I presume that’s because of the urlencoding.

Is there some trick with the Xojo Framework HTTPSocket that I’m missing?

[quote=252966:@Jonathan Ashwell]I submit it like this (if I enter the URL in a browser it works, btw):

mySocket.send (“GET”, “http://www.crossref.org/guestquery/?queryType=doi&restype=unixref&doi_search=Search&doi=10.1175/1520-0442(1988)001<0715:COAPSR>2.0.CO;2”)

But this generates a “Request url is not well-formed.” exception.[/quote]

For what it’s worth, the web browser is rewriting the URL before sending it to the web server. It gets sent as:

http://www.crossref.org/guestquery/?queryType=doi&restype=unixref&doi_search=Search&doi=10.1175/1520-0442(1988)001%3C0715:COAPSR%3E2.0.CO;2

The problem with EndcodeURLComponent is that each component of a URL has different rules on what needs to be escaped and EndcodeURLComponent doesn’t know which rules to use, so it’s very conservative and escapes when it doesn’t need to. According to RFC 3986, the allowable characters in the fragment component of a URL are:

abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-._~%:/?#[]@!$&'()*+,;=