mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-22 03:41:28 +08:00
Update types for requests.adapters (#2614)
This commit is contained in:
committed by
Sebastian Rittau
parent
59040f08a6
commit
8aa5feac57
23
third_party/2and3/requests/adapters.pyi
vendored
23
third_party/2and3/requests/adapters.pyi
vendored
@@ -1,6 +1,6 @@
|
||||
# Stubs for requests.adapters (Python 3)
|
||||
|
||||
from typing import Any, Container, Union, Text, Tuple
|
||||
from typing import Any, Container, Union, Text, Tuple, Optional, Mapping
|
||||
from . import models
|
||||
from .packages.urllib3 import poolmanager
|
||||
from .packages.urllib3 import response
|
||||
@@ -44,12 +44,15 @@ DEFAULT_RETRIES = ... # type: Any
|
||||
|
||||
class BaseAdapter:
|
||||
def __init__(self) -> None: ...
|
||||
def send(self, request: PreparedRequest, stream: bool = ...,
|
||||
def send(self,
|
||||
request: PreparedRequest,
|
||||
stream: bool = ...,
|
||||
timeout: Union[None, float, Tuple[float, float]] = ...,
|
||||
verify: bool = ...,
|
||||
cert: Union[None, Union[bytes, Text], Container[Union[bytes, Text]]] = ...
|
||||
) -> Response: ...
|
||||
verify: Union[bool, str] = ...,
|
||||
cert: Union[None, Union[bytes, Text], Container[Union[bytes, Text]]] = ...,
|
||||
proxies: Optional[Mapping[str, str]] = ...) -> Response: ...
|
||||
def close(self) -> None: ...
|
||||
|
||||
class HTTPAdapter(BaseAdapter):
|
||||
__attrs__ = ... # type: Any
|
||||
max_retries = ... # type: Any
|
||||
@@ -67,6 +70,10 @@ class HTTPAdapter(BaseAdapter):
|
||||
def request_url(self, request, proxies): ...
|
||||
def add_headers(self, request, **kwargs): ...
|
||||
def proxy_headers(self, proxy): ...
|
||||
# TODO: "request" is not actually optional, modified to please mypy.
|
||||
def send(self, request=..., stream=..., timeout=..., verify=..., cert=...,
|
||||
proxies=...): ...
|
||||
def send(self,
|
||||
request: PreparedRequest,
|
||||
stream: bool = ...,
|
||||
timeout: Union[None, float, Tuple[float, float]] = ...,
|
||||
verify: Union[bool, str] = ...,
|
||||
cert: Union[None, Union[bytes, Text], Container[Union[bytes, Text]]] = ...,
|
||||
proxies: Optional[Mapping[str, str]] = ...) -> Response: ...
|
||||
|
||||
Reference in New Issue
Block a user