Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

request should be a public attribute/property of ClientResponse #1482

Closed
garyvdm opened this issue Dec 15, 2016 · 5 comments
Closed

request should be a public attribute/property of ClientResponse #1482

garyvdm opened this issue Dec 15, 2016 · 5 comments
Labels

Comments

@garyvdm
Copy link

garyvdm commented Dec 15, 2016

In order to debug my application, I wanted to inspect attributes of the request (e.g. headers). I could not find a way to do this, and ended up hacking the aiohttp code to do this.

It would be nice if request was a public attribute/property of ClientResponse so that one could do this:

async with aiohttp.ClientSession(headers=...) as session:
    async with session.get('https://api.github.com/events', headers=...) as resp:
        print(resp.request.headers)

@asvetlov
Copy link
Member

I don't want to expose ClientRequest class -- it has too many internal details which should be never touched by user.
But I'm ok with introducing RequestInfo named tuple with url and headers fields.

@garyvdm would you make a Pull Request?

@AraHaan
Copy link
Contributor

AraHaan commented Dec 24, 2016

hmm I could look at it then add tests for it if I could can get it to do such sometime.

@penguinolog
Copy link
Contributor

#1733 - ClientResponse implementation (mistakenly used another bug id).

@fafhrd91
Copy link
Member

#1733 is merged

@lock
Copy link

lock bot commented Oct 28, 2019

This thread has been automatically locked since there has not been
any recent activity after it was closed. Please open a new issue for
related bugs.

If you feel like there's important points made in this discussion,
please include those exceprts into that new issue.

@lock lock bot added the outdated label Oct 28, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Oct 28, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

5 participants