Skip to content

Updating request headers according to request body (Custom Authentication) #6627

Answered by byildiz
byildiz asked this question in Q&A
Discussion options

You must be logged in to vote

I think I should write my workaround as an answer:

I solved my problem by using json.dumps since aiohttp internally uses json.dumps to convert json data to http body by default. Here it is:

json_serialize: JSONEncoder = json.dumps,

You can call json.dumps on the data that you want to sent and you will get the exactly same body with the body aiohttp will create.

Replies: 3 comments 2 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@byildiz
Comment options

Comment options

You must be logged in to vote
1 reply
@BahmanBinary
Comment options

Answer selected by byildiz
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants