[Python-Dev] Suggestion: URL splitter that returns host, port,
request URL
Aahz
aahz at pythoncraft.com
Wed Feb 18 21:11:33 EST 2004
On Wed, Feb 18, 2004, Hamish Lawson wrote:
>
> The HTTP clients provided by many libraries (httplib in the Standard
> Library, asynchttp, Twisted) do not deal with absolute URLs but instead
> with the three component parts of host, port, and request URL. However
> these are not the parts returned by either urlparse.urlsplit or
> urlparse.urlparse. I therefore suggest it might be useful to have in the
> Standard Library a function that splits an absolute URL into host, port,
> and request URL. So for the following URL:
>
> "http://www.python.org/cgi-bin/moinmoin/FrontPage?action=edit"
>
> the function would return
>
> ("www.python.org", 80, "/cgi-bin/moinmoin/FrontPage?action=edit")
>
> An optional parameter could specify which port to use as default.
Sounds good; you'll need to post a patch on SF to make progress.
--
Aahz (aahz at pythoncraft.com) <*> http://www.pythoncraft.com/
"Argue for your limitations, and sure enough they're yours." --Richard Bach
More information about the Python-Dev
mailing list