2626 from urllib .parse import parse_qs
2727
2828 def request (url , method , headers , data = None , timeout = None ):
29- ''' Make an HTTP request in Python 3.x
29+ """ Make an HTTP request in Python 3.x
3030
3131 This method will abstract the underlying organization and invocation of
3232 the Python 3 HTTP standard lib implementation.
@@ -45,7 +45,7 @@ def request(url, method, headers, data=None, timeout=None):
4545 Returns:
4646 (dict): The response from the server interpreted as JSON.
4747
48- '''
48+ """
4949
5050 encoded_data = json .dumps (data ).encode ('utf8' ) if data else None
5151 request = Request (url , data = encoded_data , headers = headers )
@@ -71,7 +71,7 @@ def request(url, method, headers, data=None, timeout=None):
7171 from urlparse import parse_qs
7272
7373 def request (url , method , headers , data = None , timeout = None ):
74- ''' Make an HTTP request in Python 2.x
74+ """ Make an HTTP request in Python 2.x
7575
7676 This method will abstract the underlying organization and invocation of
7777 the Python 2 HTTP standard lib implementation.
@@ -90,7 +90,7 @@ def request(url, method, headers, data=None, timeout=None):
9090 Returns:
9191 (dict): The response from the server interpreted as JSON.
9292
93- '''
93+ """
9494
9595 request = Request (url )
9696 request .get_method = lambda : method
@@ -111,7 +111,7 @@ def request(url, method, headers, data=None, timeout=None):
111111
112112
113113def request_url (secure , hostname , port , path , query = None ):
114- '''
114+ """
115115 Combines url components into a url passable into the request function.
116116
117117 Args:
@@ -123,7 +123,7 @@ def request_url(secure, hostname, port, path, query=None):
123123
124124 Returns:
125125 (str) A complete url made up of the arguments.
126- '''
126+ """
127127 encoded_query = urlencode (query ) if query else ''
128128 scheme = 'https' if secure else 'http'
129129 netloc = '{0}:{1}' .format (hostname , port )
@@ -132,7 +132,7 @@ def request_url(secure, hostname, port, path, query=None):
132132
133133
134134def query_dict (url ):
135- '''
135+ """
136136 Given a url, returns a dictionary of its query parameters.
137137
138138 Args:
@@ -145,7 +145,7 @@ def query_dict(url):
145145 ...
146146 }
147147
148- '''
148+ """
149149 url_components = urlparse (url )
150150
151151 if (url_components ):
0 commit comments