Skip to content

Conversation

@bkwi
Copy link

@bkwi bkwi commented Jan 25, 2021

This PR fixes #507

Current implementation works only when we send requests using session.request("POST", url, json={'a': 1}).
When session.post(url, **kwargs) is used, kwargs will look like this:

{'data': None, 'json': {'a': 1}}

When using session.post/session.put/session.put, 'data' will always be present in kwargs (source)

This is where data = kwargs.get("data", kwargs.get("json")) retrieves None value and why request body ends up to be empty in saved cassette.

I also updated tests to cover this issue.

@bkwi bkwi changed the title Changed how json is retrieved from kwargs, updated tests Changed how json is retrieved from kwargs, updated tests [aiohttp] Jan 25, 2021
@kevin1024 kevin1024 force-pushed the master branch 3 times, most recently from df3997c to 34d5384 Compare June 26, 2023 17:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Aiohttp json body is not recorded in a cassette.

1 participant