http请求工具
Project description
使用手册
快速开始
import httper
params = {
"a": 1,
"b": 2
}
# 发送get请求
httper.get("http://localhost:8080/test/get?id=1")
httper.get("http://localhost:8080/test/get?id=1", params)
httper.get("http://localhost:8080/test/get?id=1", params=params, timeout=10, headers={})
# 发送post请求
httper.post("http://localhost:8080/test/post?id=1")
httper.post("http://localhost:8080/test/post?id=1", params)
httper.post("http://localhost:8080/test/post?id=1", params=params, timeout=10, headers={})
# 发送post表单请求
httper.postForm("http://localhost:8080/test/postForm?id=1", params)
httper.postForm("http://localhost:8080/test/postForm?id=1", form=params, timeout=10, headers={})
# 下载文件
httper.getFile("http://localhost:8080/test/getFile?id=1", "test.py")
httper.getFile("http://localhost:8080/test/getFile?id=1", "test.py", progress=True)
httper.postFile("http://localhost:8080/test/postFile?id=1", "test.py")
httper.postFile("http://localhost:8080/test/postFile?id=1", "test.py", progress=True)
httper.downloadFile("http://localhost:8080/test/downloadFile?id=1", "test.py")
httper.downloadFile("http://localhost:8080/test/downloadFile?id=1", "test.py", progress=True)
# 上传文件
httper.uploadFile("http://localhost:8080/test/uploadFile?id=1", "file1", "./files/test.py")
httper.uploadFile("http://localhost:8080/test/uploadFile?id=1", "file1", open("./files/test.py"))
httper.uploadFile("http://localhost:8080/test/uploadFile?id=1", name="file1", file="[fileBytes]", fname="test.py")
httper.uploadFile("http://localhost:8080/test/uploadFile?id=1", name="file1",
file=("", open("./files/test.py", "rb"), "image/jpeg", {"refer": "localhost"}))
httper.uploadFile("http://localhost:8080/test/uploadFile?id=1", name="file1",
file=("new_filename.py", open("./files/test.py", "rb"), "image/jpeg", {"refer": "localhost"}))
httper.uploadImage("http://localhost:8080/test/uploadImage?id=1", "file2", "./files/img1.py")
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
httper-0.0.1.tar.gz
(5.4 kB
view hashes)
Built Distributions
httper-0.0.1-py3.9.egg
(6.4 kB
view hashes)
Close
Hashes for httper-0.0.1-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5bf1819b561c23e62fb64ae846e69e9c3ee6ca2d2c7bcc2fb81bea890ccbb30a |
|
MD5 | 9764b4e4af07c49a4ff2de9f50d74b00 |
|
BLAKE2b-256 | 50ab95a99231fb8296e2f80f835343e18194926212c83467805263b17cb859ad |