1 from datetime import datetime
\r
3 Any, Callable, Iterable, Iterator, Mapping, MutableMapping, Optional, Sequence, Text, Tuple, Type, TypeVar, Union,
\r
6 from wsgiref.types import WSGIEnvironment, InputStream
\r
8 from .datastructures import (
\r
9 Authorization, CombinedMultiDict, EnvironHeaders, Headers, ImmutableMultiDict,
\r
10 MultiDict, TypeConversionDict, HeaderSet,
\r
14 charset = ... # type: str
\r
15 encoding_errors = ... # type: str
\r
16 max_content_length = ... # type: int
\r
17 max_form_memory_size = ... # type: int
\r
18 parameter_storage_class = ... # type: Type
\r
19 list_storage_class = ... # type: Type
\r
20 dict_storage_class = ... # type: Type
\r
21 form_data_parser_class = ... # type: Type
\r
22 trusted_hosts = ... # type: Optional[Sequence[Text]]
\r
23 disable_data_descriptor = ... # type: Any
\r
24 environ: WSGIEnvironment = ...
\r
25 shallow = ... # type: Any
\r
26 def __init__(self, environ: WSGIEnvironment, populate_request: bool = ..., shallow: bool = ...) -> None: ...
\r
28 def url_charset(self) -> str: ...
\r
30 def from_values(cls, *args, **kwargs) -> 'BaseRequest': ...
\r
32 def application(cls, f): ...
\r
34 def want_form_data_parsed(self): ...
\r
35 def make_form_data_parser(self): ...
\r
36 def close(self) -> None: ...
\r
37 def __enter__(self): ...
\r
38 def __exit__(self, exc_type, exc_value, tb): ...
\r
40 def stream(self) -> InputStream: ...
\r
41 input_stream: InputStream
\r
42 args = ... # type: ImmutableMultiDict
\r
44 def data(self) -> bytes: ...
\r
45 def get_data(self, cache: bool = ..., as_text: bool = ..., parse_form_data: bool = ...) -> bytes: ...
\r
46 form = ... # type: ImmutableMultiDict
\r
47 values = ... # type: CombinedMultiDict
\r
48 files = ... # type: MultiDict
\r
49 cookies = ... # type: TypeConversionDict
\r
50 headers = ... # type: EnvironHeaders
\r
51 path = ... # type: Text
\r
52 full_path = ... # type: Text
\r
53 script_root = ... # type: Text
\r
54 url = ... # type: Text
\r
55 base_url = ... # type: Text
\r
56 url_root = ... # type: Text
\r
57 host_url = ... # type: Text
\r
58 host = ... # type: Text
\r
59 query_string = ... # type: bytes
\r
60 method = ... # type: Text
\r
61 def access_route(self): ...
\r
63 def remote_addr(self) -> str: ...
\r
64 remote_user = ... # type: Text
\r
65 scheme = ... # type: str
\r
66 is_xhr = ... # type: bool
\r
67 is_secure = ... # type: bool
\r
68 is_multithread = ... # type: bool
\r
69 is_multiprocess = ... # type: bool
\r
70 is_run_once = ... # type: bool
\r
72 _OnCloseT = TypeVar('_OnCloseT', bound=Callable[[], Any])
\r
73 _SelfT = TypeVar('_SelfT', bound=BaseResponse)
\r
76 charset = ... # type: str
\r
77 default_status = ... # type: int
\r
78 default_mimetype = ... # type: str
\r
79 implicit_sequence_conversion = ... # type: bool
\r
80 autocorrect_location_header = ... # type: bool
\r
81 automatically_set_content_length = ... # type: bool
\r
82 headers = ... # type: Headers
\r
83 status_code = ... # type: int
\r
84 status = ... # type: str
\r
85 direct_passthrough = ... # type: bool
\r
86 response = ... # type: Iterable[bytes]
\r
87 def __init__(self, response: Optional[Union[str, bytes, bytearray, Iterable[str], Iterable[bytes]]] = ...,
\r
88 status: Optional[Union[Text, int]] = ...,
\r
89 headers: Optional[Union[Headers,
\r
90 Mapping[Text, Text],
\r
91 Sequence[Tuple[Text, Text]]]] = ...,
\r
92 mimetype: Optional[Text] = ...,
\r
93 content_type: Optional[Text] = ...,
\r
94 direct_passthrough: bool = ...) -> None: ...
\r
95 def call_on_close(self, func: _OnCloseT) -> _OnCloseT: ...
\r
97 def force_type(cls: Type[_SelfT], response: object, environ: Optional[WSGIEnvironment] = ...) -> _SelfT: ...
\r
99 def from_app(cls: Type[_SelfT], app: Any, environ: WSGIEnvironment, buffered: bool = ...) -> _SelfT: ...
\r
100 def get_data(self, as_text: bool = ...) -> Any: ... # returns bytes if as_text is False (the default), else Text
\r
101 def set_data(self, value: Union[bytes, Text]) -> None: ...
\r
102 data = ... # type: Any
\r
103 def calculate_content_length(self) -> Optional[int]: ...
\r
104 def make_sequence(self) -> None: ...
\r
105 def iter_encoded(self) -> Iterator[bytes]: ...
\r
106 def set_cookie(self, key, value='', max_age=None, expires=None, path='', domain=None, secure=False, httponly=False): ...
\r
107 def delete_cookie(self, key, path='', domain=None): ...
\r
109 def is_streamed(self) -> bool: ...
\r
111 def is_sequence(self) -> bool: ...
\r
112 def close(self) -> None: ...
\r
113 def __enter__(self): ...
\r
114 def __exit__(self, exc_type, exc_value, tb): ...
\r
115 # The no_etag argument if fictional, but required for compatibility with
\r
116 # ETagResponseMixin
\r
117 def freeze(self, no_etag: bool = ...) -> None: ...
\r
118 def get_wsgi_headers(self, environ): ...
\r
119 def get_app_iter(self, environ): ...
\r
120 def get_wsgi_response(self, environ): ...
\r
121 def __call__(self, environ, start_response): ...
\r
124 def accept_mimetypes(self): ...
\r
125 def accept_charsets(self): ...
\r
126 def accept_encodings(self): ...
\r
127 def accept_languages(self): ...
\r
129 class ETagRequestMixin:
\r
130 def cache_control(self): ...
\r
131 def if_match(self): ...
\r
132 def if_none_match(self): ...
\r
133 def if_modified_since(self): ...
\r
134 def if_unmodified_since(self): ...
\r
135 def if_range(self): ...
\r
136 def range(self): ...
\r
138 class UserAgentMixin:
\r
139 def user_agent(self): ...
\r
141 class AuthorizationMixin:
\r
143 def authorization(self) -> Optional[Authorization]: ...
\r
145 class StreamOnlyMixin:
\r
146 disable_data_descriptor = ... # type: Any
\r
147 want_form_data_parsed = ... # type: Any
\r
149 class ETagResponseMixin:
\r
151 def cache_control(self): ...
\r
152 status_code = ... # type: Any
\r
153 def make_conditional(self, request_or_environ, accept_ranges=False, complete_length=None): ...
\r
154 def add_etag(self, overwrite=False, weak=False): ...
\r
155 def set_etag(self, etag, weak=False): ...
\r
156 def get_etag(self): ...
\r
157 def freeze(self, no_etag: bool = ...) -> None: ...
\r
158 accept_ranges = ... # type: Any
\r
159 content_range = ... # type: Any
\r
161 class ResponseStream:
\r
162 mode = ... # type: Any
\r
163 response = ... # type: Any
\r
164 closed = ... # type: Any
\r
165 def __init__(self, response): ...
\r
166 def write(self, value): ...
\r
167 def writelines(self, seq): ...
\r
168 def close(self): ...
\r
169 def flush(self): ...
\r
170 def isatty(self): ...
\r
172 def encoding(self): ...
\r
174 class ResponseStreamMixin:
\r
176 def stream(self) -> ResponseStream: ...
\r
178 class CommonRequestDescriptorsMixin:
\r
180 def content_type(self) -> Optional[str]: ...
\r
182 def content_length(self) -> Optional[int]: ...
\r
184 def content_encoding(self) -> Optional[str]: ...
\r
186 def content_md5(self) -> Optional[str]: ...
\r
188 def referrer(self) -> Optional[str]: ...
\r
190 def date(self) -> Optional[datetime]: ...
\r
192 def max_forwards(self) -> Optional[int]: ...
\r
194 def mimetype(self) -> str: ...
\r
196 def mimetype_params(self) -> Mapping[str, str]: ...
\r
198 def pragma(self) -> HeaderSet: ...
\r
200 class CommonResponseDescriptorsMixin:
\r
201 mimetype: Optional[str] = ...
\r
203 def mimetype_params(self) -> MutableMapping[str, str]: ...
\r
204 location: Optional[str] = ...
\r
205 age: Any = ... # get: Optional[datetime.timedelta]
\r
206 content_type: Optional[str] = ...
\r
207 content_length: Optional[int] = ...
\r
208 content_location: Optional[str] = ...
\r
209 content_encoding: Optional[str] = ...
\r
210 content_md5: Optional[str] = ...
\r
211 date: Any = ... # get: Optional[datetime.datetime]
\r
212 expires: Any = ... # get: Optional[datetime.datetime]
\r
213 last_modified: Any = ... # get: Optional[datetime.datetime]
\r
214 retry_after: Any = ... # get: Optional[datetime.datetime]
\r
215 vary: Optional[str] = ...
\r
216 content_language: Optional[str] = ...
\r
217 allow: Optional[str] = ...
\r
219 class WWWAuthenticateMixin:
\r
221 def www_authenticate(self): ...
\r
223 class Request(BaseRequest, AcceptMixin, ETagRequestMixin, UserAgentMixin, AuthorizationMixin, CommonRequestDescriptorsMixin): ...
\r
224 class PlainRequest(StreamOnlyMixin, Request): ...
\r
225 class Response(BaseResponse, ETagResponseMixin, ResponseStreamMixin, CommonResponseDescriptorsMixin, WWWAuthenticateMixin): ...
\r