File: httplib.pyi

package info (click to toggle)
mypy 0.470-complete-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 5,864 kB
  • ctags: 3,264
  • sloc: python: 21,838; makefile: 18
file content (189 lines) | stat: -rw-r--r-- 6,053 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
# Stubs for httplib (Python 2)
#
# Generated by stubgen and manually massaged a bit.
# Needs lots more work!

from typing import Any, Dict
import mimetools

class HTTPMessage(mimetools.Message):
    def addheader(self, key: str, value: str) -> None: ...
    def addcontinue(self, key: str, more: str) -> None: ...
    dict = ...  # type: Dict[str, str]
    unixfrom = ...  # type: str
    headers = ...  # type: Any
    status = ...  # type: str
    seekable = ...  # type: bool
    def readheaders(self) -> None: ...

class HTTPResponse:
    fp = ...  # type: Any
    debuglevel = ...  # type: Any
    strict = ...  # type: Any
    msg = ...  # type: Any
    version = ...  # type: Any
    status = ...  # type: Any
    reason = ...  # type: Any
    chunked = ...  # type: Any
    chunk_left = ...  # type: Any
    length = ...  # type: Any
    will_close = ...  # type: Any
    def __init__(self, sock, debuglevel=0, strict=0, method=None, buffering: bool=...) -> None: ...
    def begin(self): ...
    def close(self): ...
    def isclosed(self): ...
    def read(self, amt=None): ...
    def fileno(self): ...
    def getheader(self, name, default=None): ...
    def getheaders(self): ...

class HTTPConnection:
    response_class = ...  # type: Any
    default_port = ...  # type: Any
    auto_open = ...  # type: Any
    debuglevel = ...  # type: Any
    strict = ...  # type: Any
    timeout = ...  # type: Any
    source_address = ...  # type: Any
    sock = ...  # type: Any
    def __init__(self, host, port=None, strict=None, timeout=..., source_address=None) -> None: ...
    def set_tunnel(self, host, port=None, headers=None): ...
    def set_debuglevel(self, level): ...
    def connect(self): ...
    def close(self): ...
    def send(self, data): ...
    def putrequest(self, method, url, skip_host=0, skip_accept_encoding=0): ...
    def putheader(self, header, *values): ...
    def endheaders(self, message_body=None): ...
    def request(self, method, url, body=None, headers=...): ...
    def getresponse(self, buffering: bool=...): ...

class HTTP:
    debuglevel = ...  # type: Any
    def __init__(self, host: str=..., port=None, strict=None) -> None: ...
    def connect(self, host=None, port=None): ...
    def getfile(self): ...
    file = ...  # type: Any
    headers = ...  # type: Any
    def getreply(self, buffering: bool=...): ...
    def close(self): ...

class HTTPSConnection(HTTPConnection):
    default_port = ...  # type: Any
    key_file = ...  # type: Any
    cert_file = ...  # type: Any
    def __init__(self, host, port=None, key_file=None, cert_file=None, strict=None, timeout=..., source_address=None, context=None) -> None: ...
    sock = ...  # type: Any
    def connect(self): ...

class HTTPS(HTTP):
    key_file = ...  # type: Any
    cert_file = ...  # type: Any
    def __init__(self, host: str=..., port=None, key_file=None, cert_file=None, strict=None, context=None) -> None: ...

class HTTPException(Exception): ...
class NotConnected(HTTPException): ...
class InvalidURL(HTTPException): ...

class UnknownProtocol(HTTPException):
    args = ...  # type: Any
    version = ...  # type: Any
    def __init__(self, version) -> None: ...

class UnknownTransferEncoding(HTTPException): ...
class UnimplementedFileMode(HTTPException): ...

class IncompleteRead(HTTPException):
    args = ...  # type: Any
    partial = ...  # type: Any
    expected = ...  # type: Any
    def __init__(self, partial, expected=None) -> None: ...

class ImproperConnectionState(HTTPException): ...
class CannotSendRequest(ImproperConnectionState): ...
class CannotSendHeader(ImproperConnectionState): ...
class ResponseNotReady(ImproperConnectionState): ...

class BadStatusLine(HTTPException):
    args = ...  # type: Any
    line = ...  # type: Any
    def __init__(self, line) -> None: ...

class LineTooLong(HTTPException):
    def __init__(self, line_type) -> None: ...

error = ...  # type: Any

class LineAndFileWrapper:
    def __init__(self, line, file) -> None: ...
    def __getattr__(self, attr): ...
    def read(self, amt=None): ...
    def readline(self): ...
    def readlines(self, size=None): ...

# Constants

responses = ...  # type: Dict[int, str]

HTTP_PORT = ...  # type: int
HTTPS_PORT = ...  # type: int

# status codes
# informational
CONTINUE = ...  # type: int
SWITCHING_PROTOCOLS = ...  # type: int
PROCESSING = ...  # type: int

# successful
OK = ...  # type: int
CREATED = ...  # type: int
ACCEPTED = ...  # type: int
NON_AUTHORITATIVE_INFORMATION = ...  # type: int
NO_CONTENT = ...  # type: int
RESET_CONTENT = ...  # type: int
PARTIAL_CONTENT = ...  # type: int
MULTI_STATUS = ...  # type: int
IM_USED = ...  # type: int

# redirection
MULTIPLE_CHOICES = ...  # type: int
MOVED_PERMANENTLY = ...  # type: int
FOUND = ...  # type: int
SEE_OTHER = ...  # type: int
NOT_MODIFIED = ...  # type: int
USE_PROXY = ...  # type: int
TEMPORARY_REDIRECT = ...  # type: int

# client error
BAD_REQUEST = ...  # type: int
UNAUTHORIZED = ...  # type: int
PAYMENT_REQUIRED = ...  # type: int
FORBIDDEN = ...  # type: int
NOT_FOUND = ...  # type: int
METHOD_NOT_ALLOWED = ...  # type: int
NOT_ACCEPTABLE = ...  # type: int
PROXY_AUTHENTICATION_REQUIRED = ...  # type: int
REQUEST_TIMEOUT = ...  # type: int
CONFLICT = ...  # type: int
GONE = ...  # type: int
LENGTH_REQUIRED = ...  # type: int
PRECONDITION_FAILED = ...  # type: int
REQUEST_ENTITY_TOO_LARGE = ...  # type: int
REQUEST_URI_TOO_LONG = ...  # type: int
UNSUPPORTED_MEDIA_TYPE = ...  # type: int
REQUESTED_RANGE_NOT_SATISFIABLE = ...  # type: int
EXPECTATION_FAILED = ...  # type: int
UNPROCESSABLE_ENTITY = ...  # type: int
LOCKED = ...  # type: int
FAILED_DEPENDENCY = ...  # type: int
UPGRADE_REQUIRED = ...  # type: int

# server error
INTERNAL_SERVER_ERROR = ...  # type: int
NOT_IMPLEMENTED = ...  # type: int
BAD_GATEWAY = ...  # type: int
SERVICE_UNAVAILABLE = ...  # type: int
GATEWAY_TIMEOUT = ...  # type: int
HTTP_VERSION_NOT_SUPPORTED = ...  # type: int
INSUFFICIENT_STORAGE = ...  # type: int
NOT_EXTENDED = ...  # type: int