CompactClient
A client with 8 methods (stays inline since 8 <= 10).
Usage
CompactClient()Parameters
host: str-
The server hostname.
Methods
| Name | Description |
|---|---|
| close() | Close the client connection. |
| delete() | Send a DELETE request. |
| get() | Send a GET request. |
| head() | Send a HEAD request. |
| options() | Send an OPTIONS request. |
| patch() | Send a PATCH request. |
| post() | Send a POST request. |
| put() | Send a PUT request. |
close()
Close the client connection.
Usage
close()delete()
Send a DELETE request.
Usage
delete(path)Parameters
path: str-
Request path.
Returns
bool-
True if successful.
get()
Send a GET request.
Usage
get(path)Parameters
path: str-
Request path.
Returns
dict-
Response payload.
head()
Send a HEAD request.
Usage
head(path)Parameters
path: str-
Request path.
Returns
dict-
Response headers.
options()
Send an OPTIONS request.
Usage
options(path)Parameters
path: str-
Request path.
Returns
list-
Allowed methods.
patch()
Send a PATCH request.
Usage
patch(path, body)Parameters
path: str-
Request path.
body: dict-
Partial update payload.
Returns
dict-
Response payload.
post()
Send a POST request.
Usage
post(path, body)Parameters
path: str-
Request path.
body: dict-
Request body.
Returns
dict-
Response payload.
put()
Send a PUT request.
Usage
put(path, body)Parameters
path: str-
Request path.
body: dict-
Request body.
Returns
dict-
Response payload.