mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-06 12:14:27 +08:00
requests.(post|put|patch) json kwarg should be Any. (#1387)
```python
>>> requests.post('https://httpbin.org/post', json=["ham", "spam", {"eggs": "bacon"}]).json()
{'args': {}, 'data': '["ham", "spam", {"eggs": "bacon"}]', 'files': {}, 'form': {}, 'headers': {'Accept': '*/*', 'Accept-Encoding': 'gzip, deflate', 'Connection': 'close', 'Content-Length': '34', 'Content-Type': 'application/json', 'Host': 'httpbin.org', 'User-Agent': 'python-requests/2.17.3'}, 'json': ['ham', 'spam', {'eggs': 'bacon'}], 'origin': '82.70.100.78', 'url': 'https://httpbin.org/post'}
>>> requests.post('https://httpbin.org/post', json=("ham", "spam", {"eggs": "bacon"})).json()
{'args': {}, 'data': '["ham", "spam", {"eggs": "bacon"}]', 'files': {}, 'form': {}, 'headers': {'Accept': '*/*', 'Accept-Encoding': 'gzip, deflate', 'Connection': 'close', 'Content-Length': '34', 'Content-Type': 'application/json', 'Host': 'httpbin.org', 'User-Agent': 'python-requests/2.17.3'}, 'json': ['ham', 'spam', {'eggs': 'bacon'}], 'origin': '82.70.100.78', 'url': 'https://httpbin.org/post'}
```
This commit is contained in:
committed by
Matthias Kramm
parent
25b3a818d3
commit
55f1883928
6
third_party/2and3/requests/api.pyi
vendored
6
third_party/2and3/requests/api.pyi
vendored
@@ -20,7 +20,7 @@ def get(url: Union[Text, bytes],
|
||||
**kwargs) -> Response: ...
|
||||
def options(url: Union[str, Text], **kwargs) -> Response: ...
|
||||
def head(url: Union[str, Text], **kwargs) -> Response: ...
|
||||
def post(url: Union[str, Text], data: _Data = ..., json: Optional[MutableMapping] = ..., **kwargs) -> Response: ...
|
||||
def put(url: Union[str, Text], data: _Data = ..., **kwargs) -> Response: ...
|
||||
def patch(url: Union[str, Text], data: _Data = ..., **kwargs) -> Response: ...
|
||||
def post(url: Union[str, Text], data: _Data=..., json=..., **kwargs) -> Response: ...
|
||||
def put(url: Union[str, Text], data: _Data=..., json=..., **kwargs) -> Response: ...
|
||||
def patch(url: Union[str, Text], data: _Data=..., json=..., **kwargs) -> Response: ...
|
||||
def delete(url: Union[str, Text], **kwargs) -> Response: ...
|
||||
|
||||
Reference in New Issue
Block a user