A lite client for restful APIs.
Project description
restful-client-lite
A lite client for RESTFul APIs.
WIP.
Installation
pipenv:
pipenv install -e git+https://github.com/huandzh/restful-client-lite#egg=restful-client-lite
pip:
pip install -e git+https://github.com/huandzh/restful-client-lite#egg=restful-client-lite
Usage
Assume that we have a restful api requiring Authorization:<token>
in the header and using etag to control writes.
Create an API client:
from restful_client_lite import APIClient
api = APIClient("<api_root>", {"token": "<token>"})
Get from url:
res_get = api.get("<url>")
Post to url:
res_post = api.post("<url>", data={"<key>": "<value>"})
Patch url:
res_patch = api.patch("<url>", "<etag>", data={"<key>": "<value>"})
Patch url (fetch etag automatically in advance):
res_patch = api.patch_auto_etag("<url>", data={"<key>": "<value>"})
Delete url:
res_delete = api.delete("<url>", "<etag>")
Delete url (fetch etag automatically in advance):
res_delete = api.delete_auto_etag("<url>")
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Close
Hashes for restful-client-lite-0.0.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | a9debdbb5a909e4faecd9fa3dee12a246e40f4a32cff77ff4175ad14aa2a8e1b |
|
MD5 | 99a1cda63e73af5868975f1f9157a31f |
|
BLAKE2b-256 | b3f63143c0bdb8b10737171f28426a3f80d0e26e5b3ca592c07246684e923af3 |