Name
request
Synopsis
h.request(command,URL,data=None,headers={})
Sends
a request to the HTTP server. command is
an HTTP command string, such as 'GET' or
'POST‘. URL is an HTTP
selector (i.e., a URL string without the scheme and location
components—just the path component, possibly followed by query
and/or fragment components). data, if not
None, is a string sent as the body of the request,
normally meaningful only for such commands as
'POST' and 'PUT‘.
request computes and sends the Content-Length
header to describe the length of data. To
send other headers, pass them as part of dictionary argument
headers, with the header name as the key
and the header contents as the corresponding value.
Module httplib also supplies class
HTTPSConnection, used in exactly the same way as
class HTTPConnection but supporting connections
that use protocol https rather than protocol
http.
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access