A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2004-February/042600.html below:

URL splitter that returns host, port, request URL

[Python-Dev] Suggestion: URL splitter that returns host, port, request URLHamish Lawson hbl at st-andrews.ac.uk
Wed Feb 18 12:51:41 EST 2004
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.


Hamish Lawson

More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4