How do I access the error stream using the Python requests library? For example, using HttpURLConnection in Java, I would do something like:
InputStream errorStream = conn.getErrorStream();
Is there a function like this with requests?
I'm looking for the error message in the response that was supplied by the source, NOT the error status e.g. Internal Server Error
getInputStream, which gets the response content, would throw an exception if the response code was an error response. In that situation you'd have to callgetErrorStream. Are you saying thatrequeststreats them both the same? So callingresponse.textwill give me whatever is available?