How to add bearer token that may need updating to auth header? #6908
-
Trying to figure out how best passing a bearer token with an aiohttp client when sending requests. I understand i can pass What's the best approach to configure a client with such a "dynamic" auth header (without having to evaluate and pass the header manually prior to making every request)? This is basically the same question as https://stackoverflow.com/questions/63248239/automatically-refresh-auth-token-in-aiohttp |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 6 replies
-
Just a quick guess from looking at the documentation. The headers appear to be accessible on the ClientSession: https://docs.aiohttp.org/en/stable/client_reference.html#aiohttp.ClientSession.headers So, just update the header value there? |
Beta Was this translation helpful? Give feedback.
Just a quick guess from looking at the documentation. The headers appear to be accessible on the ClientSession: https://docs.aiohttp.org/en/stable/client_reference.html#aiohttp.ClientSession.headers
So, just update the header value there?