@@ -93,8 +93,7 @@ def get(self, url, params=None, **kwargs):
9393 erc = kwargs .pop ('erc' , ERC ['GET' ])
9494 _raise_if_extra_kwargs (kwargs )
9595 # API request
96- response = self ._req_session .get (abs_url ,
97- params = params ,
96+ response = self ._req_session .get (abs_url , params = params ,
9897 timeout = timeout )
9998 # Process response
10099 _check_response_code (response , erc )
@@ -110,8 +109,7 @@ def get_pages(self, url, params=None, **kwargs):
110109 erc = kwargs .pop ('erc' , ERC ['GET' ])
111110 _raise_if_extra_kwargs (kwargs )
112111 # API request - get first page
113- response = self ._req_session .get (abs_url ,
114- params = params ,
112+ response = self ._req_session .get (abs_url , params = params ,
115113 timeout = timeout )
116114 while True :
117115 # Process response - Yield page's JSON data
@@ -142,36 +140,32 @@ def get_items(self, url, params=None, **kwargs):
142140 % json_page
143141 raise ciscosparkapiException (error_message )
144142
145- def post (self , url , json_dict , ** kwargs ):
143+ def post (self , url , json , ** kwargs ):
146144 # Process args
147145 assert isinstance (url , basestring )
148- assert isinstance (json_dict , dict )
146+ assert isinstance (json , dict )
149147 abs_url = self .urljoin (url )
150148 # Process kwargs
151149 timeout = kwargs .pop ('timeout' , self .timeout )
152150 erc = kwargs .pop ('erc' , ERC ['POST' ])
153151 _raise_if_extra_kwargs (kwargs )
154152 # API request
155- response = self ._req_session .post (abs_url ,
156- json = json_dict ,
157- timeout = timeout )
153+ response = self ._req_session .post (abs_url , json = json , timeout = timeout )
158154 # Process response
159155 _check_response_code (response , erc )
160156 return _extract_and_parse_json (response )
161157
162- def put (self , url , json_dict , ** kwargs ):
158+ def put (self , url , json , ** kwargs ):
163159 # Process args
164160 assert isinstance (url , basestring )
165- assert isinstance (json_dict , dict )
161+ assert isinstance (json , dict )
166162 abs_url = self .urljoin (url )
167163 # Process kwargs
168164 timeout = kwargs .pop ('timeout' , self .timeout )
169165 erc = kwargs .pop ('erc' , ERC ['PUT' ])
170166 _raise_if_extra_kwargs (kwargs )
171167 # API request
172- response = self ._req_session .put (abs_url ,
173- json = json_dict ,
174- timeout = timeout )
168+ response = self ._req_session .put (abs_url , json = json , timeout = timeout )
175169 # Process response
176170 _check_response_code (response , erc )
177171 return _extract_and_parse_json (response )
0 commit comments