Response Codes¶
The bareUtils module bareutils.response_codes provides constants and helper
functions for dealing with response codes
More information can be found in the api.
For example bareClient might check for a response code of 200 (OK):
1 2 3 4 5 6 7 8 9 10 11 | |
We import the module using the from syntax on line 3 in order to make everything
in the module available. The we can use response_code.OK on line 7.
If we just wanted to test for a valid response code we could have used
response_code.is_successful(response['status_code']).