예제 #1
0
    def __init__(self, url, body='', headers=None, method='GET'):
        """Initialize the URLRequest.

        Args:
            url (unicode):
                The URL to make the request against.

            body (unicode or bytes):
                The content of the request.

            headers (dict, optional):
                Additional headers to attach to the request.

            method (unicode, optional):
                The request method. If not provided, it defaults to a ``GET``
                request.
        """
        BaseURLRequest.__init__(self, url, body, headers or {})
        self.method = method
예제 #2
0
    def __init__(self, url, body='', headers=None, method='GET'):
        """Initialize the URLRequest.

        Args:
            url (unicode):
                The URL to make the request against.

            body (unicode or bytes):
                The content of the request.

            headers (dict, optional):
                Additional headers to attach to the request.

            method (unicode, optional):
                The request method. If not provided, it defaults to a ``GET``
                request.
        """
        # Request is an old-style class and therefore we cannot use super().
        BaseURLRequest.__init__(self, url, body, headers or {})
        self.method = method
예제 #3
0
 def __init__(self, url, body='', headers={}, method='GET'):
     BaseURLRequest.__init__(self, url, body, headers)
     self.method = method
예제 #4
0
 def __init__(self, url, body='', headers={}, method='GET'):
     BaseURLRequest.__init__(self, url, body, headers)
     self.method = method