0 purchases
reqrest 1.0.1
reqrest
A package for using REST APIs
Purpose
A lot of APIs are REST based, reqrest provides an easy way to use them.
Usage
Getting started is easy, first install the package using pip install reqrest
Next import it
from reqrest import REST
RESTAPI = REST('postman-echo.com')
Then query your API
RESTAPI.get('/get')
You can add custom headers
custom_headers = {"authorization": "Basic dXNlcm5hbWU6cGFzc3dvcmQ="}
RESTAPI = REST('postman-echo.com', headers=custom_headers)
Or querystrings
querystring = {}
querystring[pagesize] = 1000
RESTAPI.get('/get', querystring=querystring)
Have a read of examples/simple.py
Authentication
You can use basic_auth to create and store your headers / config
headers = Auth().read_config("basic_config.json")
RESTAPI = REST('postman-echo.com', headers=headers)
For personal and professional use. You cannot resell or redistribute these repositories in their original state.
There are no reviews.