Skip to main content

Wrapper around http.client

Project description

ethanypc-simplerequest

A simpler API built on top of Python's http.client.

Support for Python 3 only.

Install

# from pypi
pip install ethanypc-simplerequest

# from testpypi
pip install -i https://test.pypi.org/simple/ ethanypc-simplerequest

Usage

import simplehttp

r = simplehttp.get_json("https://httpbin.org/get")
assert r["args"] == {}  

r2 = simplehttp.get_json("https://httpbin.org/get?debug=true",
				 params={"name": "常⾒見見問題 Q&A"})
assert r2["args"] == {"debug": "true", "name": "常⾒見見問題 Q&A"}


data = {"isbn": "9789863479116", "title": u"流暢的 Python"}
r3 = simplehttp.post_json("https://httpbin.org/post",
			 params={"debug": "true"}, data=data)
assert r3["args"] == {"debug": "true"}
assert json.loads(r3["json"]) == data

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

ethanypc-simplerequest-1.0.3.tar.gz (3.0 kB view hashes)

Uploaded Source

Built Distribution

ethanypc_simplerequest-1.0.3-py3-none-any.whl (4.0 kB view hashes)

Uploaded Python 3

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