mirror of
https://github.com/kevin1024/vcrpy.git
synced 2025-12-09 01:03:24 +00:00
aiohttp: Allow both data and json arguments (#624)
If at least one of them is `None`. Previously, a `data=None` parameter would cause the `json` parameter to be ignored, resulting in an empty request body payload on the cassette.
This commit is contained in:
committed by
GitHub
parent
b28316ab10
commit
31d8c3498b
@@ -245,7 +245,11 @@ def vcr_request(cassette, real_request):
|
||||
headers = kwargs.get("headers")
|
||||
auth = kwargs.get("auth")
|
||||
headers = self._prepare_headers(headers)
|
||||
data = kwargs.get("data", kwargs.get("json"))
|
||||
data = kwargs.get("data")
|
||||
if data is None:
|
||||
data = kwargs.get("json")
|
||||
elif kwargs.get("json") is not None:
|
||||
raise ValueError("data and json parameters can not be used at the same time")
|
||||
params = kwargs.get("params")
|
||||
cookies = kwargs.get("cookies")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user