Reputation: 141
I'm calling google API from python requests, I'm able to get response from the API also able to extract status code if request is failing like 404. But how do I get success response as 200? I do not see any attribute with that status.
For example:
request = service.disks().get(project=project, zone=zone, disk=disk).execute()
response.status
or response.status_code
does not help.
Upvotes: 0
Views: 463
Reputation: 1028
The service.disks().get(project=project, zone=zone, disk=disk).execute()
returns the dictionary.
Check the request['status']
, it will return READY
.
Upvotes: 2