Skip to content
This repository was archived by the owner on Aug 11, 2020. It is now read-only.

Commit 3958495

Browse files
kossakdandruszak
authored andcommitted
moving request logging to be visible request fail
1 parent 22b61ef commit 3958495

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

paperspace/client.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,27 +30,27 @@ def get_path(self, url):
3030

3131
def post(self, url, json=None, params=None, files=None):
3232
path = self.get_path(url)
33-
response = requests.post(path, json=json, params=params, headers=self.headers, files=files)
3433
logger.debug("POST request sent to: {} \n\theaders: {}\n\tjson: {}\n\tparams: {}"
35-
.format(response.url, self.headers, json, params))
34+
.format(path, self.headers, json, params))
35+
response = requests.post(path, json=json, params=params, headers=self.headers, files=files)
3636
logger.debug("Response status code: {}".format(response.status_code))
3737
logger.debug("Response content: {}".format(response.content))
3838
return response
3939

4040
def put(self, url, json=None, params=None):
4141
path = self.get_path(url)
42-
response = requests.put(path, json=json, params=params, headers=self.headers)
4342
logger.debug("PUT request sent to: {} \n\theaders: {}\n\tjson: {}\n\tparams: {}"
44-
.format(response.url, self.headers, json, params))
43+
.format(path, self.headers, json, params))
44+
response = requests.put(path, json=json, params=params, headers=self.headers)
4545
logger.debug("Response status code: {}".format(response.status_code))
4646
logger.debug("Response content: {}".format(response.content))
4747
return response
4848

4949
def get(self, url, json=None, params=None):
5050
path = self.get_path(url)
51-
response = requests.get(path, params=params, headers=self.headers, json=json)
5251
logger.debug("GET request sent to: {} \n\theaders: {}\n\tjson: {}\n\tparams: {}"
53-
.format(response.url, self.headers, json, params))
52+
.format(path, self.headers, json, params))
53+
response = requests.get(path, params=params, headers=self.headers, json=json)
5454
logger.debug("Response status code: {}".format(response.status_code))
5555
logger.debug("Response content: {}".format(response.content))
5656
return response

0 commit comments

Comments
 (0)