I've been asked to swap over from urllib2
to the requests
library because the library is simpler to use and doesn't cause exceptions.
I can get the HTTP error code with response.status_code
but I don't see a way to get the error message for that code. Normally, I wouldn't care, but I'm testing an API and the string is just as important.
Does anybody know of a simple way to get that string? I'm expecting 2 pieces something like:
'400':'Bad Request'