mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-06 20:24:30 +08:00
update requests stubs with various missing methods (#4691)
This commit is contained in:
committed by
GitHub
parent
3df3f6a1bc
commit
71e2cdcc68
4
third_party/2and3/requests/__init__.pyi
vendored
4
third_party/2and3/requests/__init__.pyi
vendored
@@ -1,5 +1,5 @@
|
||||
import logging
|
||||
from typing import Any
|
||||
from typing import Any, Text
|
||||
|
||||
from .api import (
|
||||
delete as delete,
|
||||
@@ -31,3 +31,5 @@ __version__: Any
|
||||
|
||||
class NullHandler(logging.Handler):
|
||||
def emit(self, record): ...
|
||||
|
||||
def check_compatibility(urllib3_version: Text, chardet_version: Text) -> None: ...
|
||||
|
||||
2
third_party/2and3/requests/auth.pyi
vendored
2
third_party/2and3/requests/auth.pyi
vendored
@@ -5,7 +5,6 @@ from . import cookies, models, status_codes, utils
|
||||
extract_cookies_to_jar = cookies.extract_cookies_to_jar
|
||||
parse_dict_header = utils.parse_dict_header
|
||||
to_native_string = utils.to_native_string
|
||||
codes = status_codes.codes
|
||||
|
||||
CONTENT_TYPE_FORM_URLENCODED: Any
|
||||
CONTENT_TYPE_MULTI_PART: Any
|
||||
@@ -37,3 +36,4 @@ class HTTPDigestAuth(AuthBase):
|
||||
def handle_redirect(self, r, **kwargs): ...
|
||||
def handle_401(self, r, **kwargs): ...
|
||||
def __call__(self, r): ...
|
||||
def init_per_thread_state(self) -> None: ...
|
||||
|
||||
1
third_party/2and3/requests/cookies.pyi
vendored
1
third_party/2and3/requests/cookies.pyi
vendored
@@ -56,6 +56,7 @@ class RequestsCookieJar(CookieJar, MutableMapping[Any, Any]):
|
||||
def set_cookie(self, cookie, *args, **kwargs): ...
|
||||
def update(self, other): ...
|
||||
def copy(self): ...
|
||||
def get_policy(self): ...
|
||||
|
||||
def create_cookie(name, value, **kwargs): ...
|
||||
def morsel_to_cookie(morsel): ...
|
||||
|
||||
3
third_party/2and3/requests/models.pyi
vendored
3
third_party/2and3/requests/models.pyi
vendored
@@ -40,7 +40,6 @@ REDIRECT_STATI: Any
|
||||
DEFAULT_REDIRECT_LIMIT: Any
|
||||
CONTENT_CHUNK_SIZE: Any
|
||||
ITER_CHUNK_SIZE: Any
|
||||
json_dumps: Any
|
||||
|
||||
class RequestEncodingMixin:
|
||||
@property
|
||||
@@ -117,7 +116,7 @@ class Response:
|
||||
def apparent_encoding(self) -> str: ...
|
||||
def iter_content(self, chunk_size: Optional[int] = ..., decode_unicode: bool = ...) -> Iterator[Any]: ...
|
||||
def iter_lines(
|
||||
self, chunk_size: Optional[int] = ..., decode_unicode: bool = ..., delimiter: Union[Text, bytes] = ...
|
||||
self, chunk_size: Optional[int] = ..., decode_unicode: bool = ..., delimiter: Optional[Union[Text, bytes]] = ...
|
||||
) -> Iterator[Any]: ...
|
||||
@property
|
||||
def content(self) -> bytes: ...
|
||||
|
||||
2
third_party/2and3/requests/sessions.pyi
vendored
2
third_party/2and3/requests/sessions.pyi
vendored
@@ -33,8 +33,6 @@ get_auth_from_url = utils.get_auth_from_url
|
||||
codes = status_codes.codes
|
||||
REDIRECT_STATI = models.REDIRECT_STATI
|
||||
|
||||
REDIRECT_CACHE_SIZE: Any
|
||||
|
||||
def merge_setting(request_setting, session_setting, dict_class=...): ...
|
||||
def merge_hooks(request_hooks, session_hooks, dict_class=...): ...
|
||||
|
||||
|
||||
11
third_party/2and3/requests/utils.pyi
vendored
11
third_party/2and3/requests/utils.pyi
vendored
@@ -1,4 +1,4 @@
|
||||
from typing import Any
|
||||
from typing import Any, AnyStr, Dict, Iterable, Mapping, Optional, Text, Tuple
|
||||
|
||||
from . import compat, cookies, exceptions, structures
|
||||
|
||||
@@ -14,7 +14,7 @@ DEFAULT_PORTS: Any
|
||||
|
||||
def dict_to_sequence(d): ...
|
||||
def super_len(o): ...
|
||||
def get_netrc_auth(url): ...
|
||||
def get_netrc_auth(url, raise_errors: bool = ...): ...
|
||||
def guess_filename(obj): ...
|
||||
def extract_zipped_paths(path): ...
|
||||
def from_key_val_list(value): ...
|
||||
@@ -39,9 +39,9 @@ def dotted_netmask(mask): ...
|
||||
def is_ipv4_address(string_ip): ...
|
||||
def is_valid_cidr(string_network): ...
|
||||
def set_environ(env_name, value): ...
|
||||
def should_bypass_proxies(url): ...
|
||||
def get_environ_proxies(url): ...
|
||||
def select_proxy(url, proxies): ...
|
||||
def should_bypass_proxies(url, no_proxy: Optional[Iterable[AnyStr]]) -> bool: ...
|
||||
def get_environ_proxies(url, no_proxy: Optional[Iterable[AnyStr]] = ...) -> Dict[Any, Any]: ...
|
||||
def select_proxy(url: Text, proxies: Optional[Mapping[Any, Any]]): ...
|
||||
def default_user_agent(name=...): ...
|
||||
def default_headers(): ...
|
||||
def parse_header_links(value): ...
|
||||
@@ -51,3 +51,4 @@ def get_auth_from_url(url): ...
|
||||
def to_native_string(string, encoding=...): ...
|
||||
def urldefragauth(url): ...
|
||||
def rewind_body(prepared_request): ...
|
||||
def check_header_validity(header: Tuple[AnyStr, AnyStr]) -> None: ...
|
||||
|
||||
Reference in New Issue
Block a user