vcrpy icon indicating copy to clipboard operation
vcrpy copied to clipboard

AIOHTTP not recording json body

Open cadlagtrader opened this issue 2 years ago • 1 comments

Hello - thanks for this great library !

I spotted an issue with 'data' vs 'json' in aiohttp_stubs vcr_request. When only json is present, vcrpy fails to record

The default fallback (from data to json) works when data is missing in the kwargs, but recent versions of aiohttp _request seems to have data = None when json is present (see @https://github.com/aio-libs/aiohttp/blob/40d8eb88de7674efbd6b001d04c0b91dad1f42d1/aiohttp/client.py#L375C11-L375C11)

cadlagtrader avatar Aug 14 '23 15:08 cadlagtrader

I noticed the same thing. I think the solution is for vcrpy to pull json first and fallback to data. I have a PR with the change here: https://github.com/kevin1024/vcrpy/pull/768

markis avatar Sep 22 '23 15:09 markis