HTTP Request & Response service
Simple service for testing HTTP/HTTPS requests. All endpoint responses are JSON-encoded exclude /status/{status_code: int}. It’s useful for testing how your own scripts deal with varying responses and requests.
INSTALLATION
You can use easy_install or pip to install httphq:
pip install httphq
or
easy_install httphq
ENDPOINTS
/ — Show home page
/ip — Returns client IP and proxies
/get — GET method
/post — POST method
/put — PUT method
/head — HEAD method
/options — OPTIONS method
/delete — DELETE method
/user-agent — Returns user agent
/headers — Returns sended headers
/cookies — Returns all user cookies
/cookies/set/{name: str}/{value: str} — Setup given name and value on client
/status/{status_code: int} — Returns given HTTP status code
/basic-auth/{username: str}/{password: str} — Basic access authentication
/digest-auth/{qop: auth | auth-int}/{username: str}/{password: str} — Digest access authentication
HTTP status codes
1xx Informational
2xx Success
3xx Redirection
300 — Multiple Choices
301 — Moved Permanently [ Will also return this extra header: Location: http://http.obout.ru ]
302 — Found [ Will also return this extra header: Location: http://h.wrttn.me ]
303 — See Other [ Will also return this extra header: Location: http://h.wrttn.me ]
304 — Not Modified [ Won’t return a response body ]
305 — Use Proxy [ Will also return this extra header: Location: http://h.wrttn.me ]
306 — (Unused)
307 — Temporary Redirect [ Will also return this extra header: Location: http://h.wrttn.me ]
4xx Client Error
400 — Bad Request
401 — Unauthorized [ Will also return this extra header: WWW-Authenticate: Basic realm=”Fake Realm” ]
402 — Payment Required
403 — Forbidden
404 — Not Found
405 — Method Not Allowed
406 — Not Acceptable
407 — Proxy Authentication Required [ Will also return this extra header: Proxy-Authenticate: Basic realm=”Fake Realm” ]
408 — Request Timeout
409 — Conflict
410 — Gone
411 — Length Required
412 — Precondition Failed
413 — Request Entity Too Large
414 — Request-URI Too Long
415 — Unsupported Media Type
416 — Requested Range Not Satisfiable
417 — Expectation Failed
5xx Server Error
EXAMPLES
curl http://h.wrttn.me/get | python -mjson.tool
{
"args": {},
"headers": {
"Accept": "*/*",
"Host": "h.wrttn.me",
"User-Agent": "curl/7.19.7 (i486-pc-linux-gnu) libcurl/7.19.7 OpenSSL/0.9.8k zlib/1.2.3.3 libidn/1.15"
},
"url": " http://h.wrttn.me/get"
}
curl -X POST -F "name=value" http://h.wrttn.me/post | python -mjson.tool
{
"args": {
"name": [
"value"
]
},
"body": "------------------------------eb288eb3d3e4\r\nContent-Disposition: form-data; name=\"name\"\r\n\r\nvalue\r\n------------------------------eb288eb3d3e4--\r\n",
"files": {},
"headers": {
"Accept": "*/*",
"Content-Length": "144",
"Content-Type": "multipart/form-data; boundary=----------------------------eb288eb3d3e4",
"Expect": "100-continue",
"Host": "h.wrttn.me",
"User-Agent": "curl/7.19.7 (i486-pc-linux-gnu) libcurl/7.19.7 OpenSSL/0.9.8k zlib/1.2.3.3 libidn/1.15"
},
"ip": "127.0.0.1",
"request_time": 0.04458308219909668,
"start_time": 1313996082.806412,
"url": "http://h.wrttn.me/post"
}
curl -X POST -F "test_files=@/tmp/testfile1.txt" -F "test_files=@/tmp/testfile2.txt" http://h.wrttn.me/post | python -mjson.tool
{
"args": {},
"files": {
"pictures": [
{
"body": ";klrjewfghjnq3rjehg;fqnr___j3bnr4lgfbv4riy5bguy4br5y\n",
"content_type": "text/plain",
"filename": "testfile1.txt"
},
{
"body": ";klrlfkejwknfqwdrkjnbkfgjb3erj\n",
"content_type": "text/plain",
"filename": "testfile2.txt"
}
]
},
"body": "",
"headers": {
"Accept": "*/*",
"Content-Length": "428",
"Content-Type": "multipart/form-data; boundary=----------------------------af3ea881bfa9",
"Expect": "100-continue",
"Host": "h.wrttn.me",
"User-Agent": "curl/7.19.7 (i486-pc-linux-gnu) libcurl/7.19.7 OpenSSL/0.9.8k zlib/1.2.3.3 libidn/1.15"
},
"ip": "127.0.0.1",
"request_time": 0.04804205894470215,
"start_time": 1313953495.331477,
"url": "http://h.wrttn.me/post"
}
SEE ALSO
CONTRIBUTE
Fork https://github.com/Lispython/httphq/ , create commit and pull request.
THANKS
To Kenneth Reitz who develop httpbin.org
Metadata
Release files for httphq 0.0.6
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| httphq-0.0.6.tar.gz | 79.6 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| httphq-0.0.6.linux-i686.exe | Details |
Total release size: 184.0 kB
Release files / httphq-0.0.6.tar.gz
| Download URL | httphq-0.0.6.tar.gz |
|---|---|
| Size | 79.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
59bb82de8a31c2d3cafdd2994ec12153e2f11cc4a096b68a7b4d853de6deaee3
|
|
BLAKE2b-256 checksum How to use checksums |
055df35043fbc3d67f258098b62166cf007da7cd1ee54e02a09ab67d3bba4efa
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / httphq-0.0.6.linux-i686.exe
| Download URL | httphq-0.0.6.linux-i686.exe |
|---|---|
| Size | 104.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5adb56f4373041973c98ea6706d6b0503a21af53d8b9c78c73aba116d395cbf0
|
|
BLAKE2b-256 checksum How to use checksums |
6eca39fe80c4c3d67d1c94a8655f148f4aa4068b325f2e21f33eed442c942812
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for httphq 0.0.6
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.