Skip to content

Output the response body when request returns a 400 #190

@JelleZijlstra

Description

@JelleZijlstra
  • Python version: 3.9
  • Operating System: Ubuntu
  • aiohttp version: 3.7.4

I made a request to an SSE endpoint and I hit a 400, but the error just looks like ConnectionError: fetch https://example.com/ failed: 400. To figure out what caused the 400, I had to patch aiohttp-sse-client to include the response body in the error.

It would be useful if the library provided a way to access the response body directly for cases like this. Perhaps the exceptions it throws could include the aiohttp ClientResponse object as an attribute, so callers can call e.response.read() if desired.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions