Skip to main content

Http client with base_url base on requests

Project description

requests-base-url

Languate - Python PyPI - License PyPI PyPI - Downloads

Http client with base_url base on requests

Install

pip install requests-base-url

Simple Use

from requests_base_url import http

resp = http.get('https://httpbin.org/get?a=1&b=2')
print(resp)

Config base_url

from requests_base_url import HTTP

http = HTTP(basse_url='https://httpbin.org')
resp = http.get('/get?a=1&b=2')
print(resp)

resp = http.post('/post', data=dict(a=1, b=2))
print(resp)

Config default Headers, Params or Proxies

from requests_base_url import HTTP

http = HTTP(basse_url='https://httpbin.org', headers={"token": "xxx"})
resp = http.get('/get?a=1&b=2')
print(resp)

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

requests_base_url-0.1.0.tar.gz (3.2 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page