I want to post some data to a url like
url = 'http://www.google.com/;id=aaa'
r = requests.post(url, headers=my_headers, data=my_data, timeout=10)
RFC 2616, section 3.2.2 specifies the syntax of an HTTP URL as:
http_URL = "http:" "//" host [ ":" port ] [ abs_path [ "?" query ]]
It also says:
If the abs_path is not present in the URL, it MUST be given as "/" when used as a Request-URI for a resource
In this URL:
there is no
/, so there is no
abs_path and there is no
:, so there is no
port. It means that
www.google.com;id=aaa is hostname.
Semicolons are not allowed in hostnames (see this answer for what is allowed in hostname), so this URL is invalid.
This would be a valid URL, if
id=aaa should be part of the path:
This also, if
id=aaa should be part of the query:
The question has been modified to ask about
That URL is valid, and as far as I was able to test it, python-requests handles it without any problems.