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
Built Distribution
Close
Hashes for ethanypc-simplerequest-1.0.2.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | dd1466b9c64b888cb9875d846055a3c265cd52a51232430ebe8462fa7e26f990 |
|
MD5 | 6963f7caa96f7eda7e185841723d84b6 |
|
BLAKE2b-256 | 8fa6acc5ae3411a1d2adeb6ce1b9ce0491de7037abcf25ded451859f4ebe183a |
Close
Hashes for ethanypc_simplerequest-1.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6320898a54a9b3d77099329c9c852c344147b177fecac793c3816769a4fb86ea |
|
MD5 | 4608346b1ac06ae0d20ecee6d5d6de97 |
|
BLAKE2b-256 | 246595c42d02eb4307e6a520224ef2b6a129661313eb03c2af8d24c858668193 |