Skip to main content
Join the official 2019 Python Developers SurveyStart the survey!

HTTP REST Client based on requests with dynamic url building

Project description

HTTP REST Json Client based on requests with dynamic url building


pip install mgun


from mgun import HttpClient

client = HttpClient('', headers={'Authorization': '123'})  # headers - optional

resp = client.anything.api.users[23].address.get({'q': '12'})

print(resp.status)  # 200
print(['url'])  #
print(['headers']['Authorization'])  # 123

Queries in one session

with client.session() as s:  # also possible: with client.s() as s:
    resp1 = client.anything.api.users.get({'limit': '10'}, session=s)  # request in this session
    client.anything.api.users[23].post({'data': [1, 2, 3]}, s)  # shorter
    client.anything.api.users[23].patch({'name': 'alex'}, s)

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for mgun, version 0.1.8
Filename, size File type Python version Upload date Hashes
Filename, size mgun-0.1.8-py2-none-any.whl (4.6 kB) File type Wheel Python version py2 Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page