mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-19 18:31:14 +08:00
Improve urllib3.fields annotations (#8456)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
This commit is contained in:
@@ -24,10 +24,6 @@ urllib3.connectionpool.HTTPSConnectionPool.__init__
|
||||
urllib3.connectionpool.RequestMethods.request_encode_url
|
||||
urllib3.connectionpool.VerifiedHTTPSConnection.__init__
|
||||
urllib3.connectionpool.VerifiedHTTPSConnection.set_cert
|
||||
urllib3.fields.RequestField.__init__
|
||||
urllib3.fields.RequestField.from_tuples
|
||||
urllib3.filepost.RequestField.__init__
|
||||
urllib3.filepost.RequestField.from_tuples
|
||||
urllib3.packages.ssl_match_hostname
|
||||
urllib3.packages.ssl_match_hostname._implementation
|
||||
urllib3.poolmanager.PoolManager.connection_from_host
|
||||
|
||||
@@ -1,13 +1,32 @@
|
||||
from typing import Any
|
||||
from collections.abc import Callable, Mapping
|
||||
from typing import Any, Union
|
||||
from typing_extensions import TypeAlias
|
||||
|
||||
def guess_content_type(filename, default=...): ...
|
||||
def format_header_param(name, value): ...
|
||||
_FieldValue: TypeAlias = str | bytes
|
||||
_FieldValueTuple: TypeAlias = Union[_FieldValue, tuple[str, _FieldValue], tuple[str, _FieldValue, str]]
|
||||
|
||||
def guess_content_type(filename: str | None, default: str = ...) -> str: ...
|
||||
def format_header_param_rfc2231(name: str, value: _FieldValue) -> str: ...
|
||||
def format_header_param_html5(name: str, value: _FieldValue) -> str: ...
|
||||
|
||||
format_header_param = format_header_param_html5
|
||||
|
||||
class RequestField:
|
||||
data: Any
|
||||
headers: Any
|
||||
def __init__(self, name, data, filename=..., headers=...) -> None: ...
|
||||
def __init__(
|
||||
self,
|
||||
name: str,
|
||||
data: _FieldValue,
|
||||
filename: str | None = ...,
|
||||
headers: Mapping[str, str] | None = ...,
|
||||
header_formatter: Callable[[str, _FieldValue], str] = ...,
|
||||
) -> None: ...
|
||||
@classmethod
|
||||
def from_tuples(cls, fieldname, value): ...
|
||||
def render_headers(self): ...
|
||||
def make_multipart(self, content_disposition=..., content_type=..., content_location=...): ...
|
||||
def from_tuples(
|
||||
cls, fieldname: str, value: _FieldValueTuple, header_formatter: Callable[[str, _FieldValue], str] = ...
|
||||
) -> RequestField: ...
|
||||
def render_headers(self) -> str: ...
|
||||
def make_multipart(
|
||||
self, content_disposition: str | None = ..., content_type: str | None = ..., content_location: str | None = ...
|
||||
) -> None: ...
|
||||
|
||||
Reference in New Issue
Block a user