Fix an issue with aiohttp, related posting json
Issue
There is an issue with aiohttp, when a developer sends a json kwarg it is overwritten by the data kwarg. In aiohttp the data kwarg is set to None by default and VCR will always default to None.
Resolution
We should change the kwargs check to check for the json key first and fall back to data. Because data is defaulted and will always exist. But json doesn't always exist.
fixes: #762
I think this might not be the final fix to this issue. When I apply it, the results I get for the body section comes in unrolled as more YAML, instead of being represented as a JSON string line.
I.e. when I POST a JSON body like this one to my app
{"collections": ["fields"], "intersects": {"type": "Point", "coordinates": [12.29683,55.95417]}
...it prints this:
...while it should be printing
body: '{"collections": ["fields"], "intersects": {"type": "Point", "coordinates": [12.29683,55.95417]}'
I'm not sure about the above issue, but this PR fixes the scenario for me - any chance this can get merged?
Same here, can we merge?