I am making an HTTP request from client code and I want to ensure the status of the response is a successful one. The response from my API returns a 204 upon success with no response body.
When I try to access the status code from the anvil response, I receive this error: AttributeError: 'BlobMedia' object has no attribute 'status'
The code I am using to try to access the status code is:
Darn. You can see members there for Python infrastructure (e.g., __class__), and response-specific members (e.g., get_bytes), but nothing in there that looks helpful for your question.
Well, it was worth a shot. dir can be applied to any Python object, to learn more about it.
The try block is the closest thing I can think of. If the except clause doesn’t fire, then (by definition?) it’s a success. But it might not be the specific success you’re looking for.
If that’s not close enough, then it might be time to file a Feature Request.