urllib.request.Request.has_header()

Request.has_header(header) Return whether the instance has the named header (checks both regular and unredirected).

urllib.request.Request.get_method()

Request.get_method() Return a string indicating the HTTP request method. If Request.method is not None, return its value, otherwise return 'GET' if Request.data is None, or 'POST' if it’s not. This is only meaningful for HTTP requests. Changed in version 3.3: get_method now looks at the value of Request.method.

urllib.request.Request.get_header()

Request.get_header(header_name, default=None) Return the value of the given header. If the header is not present, return the default value.

urllib.request.Request.get_full_url()

Request.get_full_url() Return the URL given in the constructor. Changed in version 3.4. Returns Request.full_url

urllib.request.Request.full_url

Request.full_url The original URL passed to the constructor. Changed in version 3.4. Request.full_url is a property with setter, getter and a deleter. Getting full_url returns the original request URL with the fragment, if it was present.

urllib.request.Request.data

Request.data The entity body for the request, or None if not specified. Changed in version 3.4: Changing value of Request.data now deletes “Content-Length” header if it was previously set or calculated.

urllib.request.Request.add_unredirected_header()

Request.add_unredirected_header(key, header) Add a header that will not be added to a redirected request.

urllib.request.Request.add_header()

Request.add_header(key, val) Add another header to the request. Headers are currently ignored by all handlers except HTTP handlers, where they are added to the list of headers sent to the server. Note that there cannot be more than one header with the same name, and later calls will overwrite previous calls in case the key collides. Currently, this is no loss of HTTP functionality, since all headers which have meaning when used more than once have a (header-specific) way of gaining the same

urllib.request.Request

class urllib.request.Request(url, data=None, headers={}, origin_req_host=None, unverifiable=False, method=None) This class is an abstraction of a URL request. url should be a string containing a valid URL. data must be a bytes object specifying additional data to send to the server, or None if no such data is needed. Currently HTTP requests are the only ones that use data; the HTTP request will be a POST instead of a GET when the data parameter is provided. data should be a buffer in the sta

urllib.request.ProxyHandler

class urllib.request.ProxyHandler(proxies=None) Cause requests to go through a proxy. If proxies is given, it must be a dictionary mapping protocol names to URLs of proxies. The default is to read the list of proxies from the environment variables <protocol>_proxy. If no proxy environment variables are set, then in a Windows environment proxy settings are obtained from the registry’s Internet Settings section, and in a Mac OS X environment proxy information is retrieved from the OS X S