Add API sketch
This commit is contained in:
parent
8a29a0a1ad
commit
fe43c08adc
90
API.md
Normal file
90
API.md
Normal file
@ -0,0 +1,90 @@
|
||||
Client(...)
|
||||
|
||||
.request(method, url, ...)
|
||||
|
||||
.get(url, ...)
|
||||
.options(url, ...)
|
||||
.head(url, ...)
|
||||
.post(url, ...)
|
||||
.put(url, ...)
|
||||
.patch(url, ...)
|
||||
.delete(url, ...)
|
||||
|
||||
.prepare_request(request)
|
||||
.send(request, ...)
|
||||
.close()
|
||||
|
||||
|
||||
Adapter()
|
||||
|
||||
.prepare_request(request)
|
||||
.send(request)
|
||||
.close()
|
||||
|
||||
|
||||
+ EnvironmentAdapter
|
||||
+ RedirectAdapter
|
||||
+ CookieAdapter
|
||||
+ AuthAdapter
|
||||
+ ConnectionPool
|
||||
+ HTTPConnection
|
||||
+ HTTP11Connection
|
||||
+ HTTP2Connection
|
||||
|
||||
|
||||
|
||||
Response(...)
|
||||
.status_code - int
|
||||
.reason_phrase - str
|
||||
.protocol - "HTTP/2" or "HTTP/1.1"
|
||||
.url - URL
|
||||
.headers - Headers
|
||||
|
||||
.content - bytes
|
||||
.text - str
|
||||
.encoding - str
|
||||
.json() - Any
|
||||
|
||||
.read() - bytes
|
||||
.stream() - bytes iterator
|
||||
.raw() - bytes iterator
|
||||
.close() - None
|
||||
|
||||
.is_redirect - bool
|
||||
.request - Request
|
||||
.cookies - Cookies
|
||||
.history - List[Response]
|
||||
|
||||
.raise_for_status()
|
||||
.next()
|
||||
|
||||
|
||||
Request(...)
|
||||
.method
|
||||
.url
|
||||
.headers
|
||||
|
||||
...
|
||||
|
||||
|
||||
Headers
|
||||
|
||||
URL
|
||||
|
||||
Origin
|
||||
|
||||
Cookies
|
||||
|
||||
|
||||
# Sync
|
||||
|
||||
SyncClient
|
||||
SyncResponse
|
||||
SyncRequest
|
||||
SyncAdapter
|
||||
|
||||
|
||||
|
||||
SSE
|
||||
HTTP/2 server push support
|
||||
Concurrency
|
||||
Loading…
Reference in New Issue
Block a user