httpcli
Just another command line HTTP client (in the spirit of cURL).
Example Usage
HTTP verbs are specified as a positional argument, followed by the URL to be acted on. The goal is to reflect the feel of a standard HTTP header. For example:
$ http get http://localhost/
To provide a request body (e.g. for a POST or PUT), use the third positional argument:
$ http post http://localhost/documents '{"json": "document"}' --content-type="application/json"
Note the arbitrary request header being specified at the end as a normal CLI option. Any such trailing CLI options will be passed as request headers:
$ http get http://localhost/ --x-forwarded-for=10.0.0.50
This would be translated as X-Forwarded-For: 10.0.0.50 in the subsequent HTTP request. To illustrate this, we can enable verbose output:
$ http get http://localhost/ --x-forwarded-for=10.0.0.50
GET http://localhost/
X-Forwarded-For: 10.0.0.50
200 OK
Status: 200
Content-Length: 396
Content-Location: http://localhost/
Date: Wed, 30 May 2012 19:26:03 GMT
Content-Type: application/json
{
"documents": [
{
"id": "c1be0fde3c0f4d27be15e1e3812cfd65b58325c3",
"value": "a"
},
{
"id": "67dc85dceacd3734ae53f1a69f56785dfe4c4c71",
"value": "b"
}
]
}
Built-In Help
Example help output:
$ http --help
usage: http [-h] [-t] method url [body] ...
Python HTTP CLI Client
positional arguments:
method HTTP method to use (OPTIONS, GET, HEAD, POST, PUT, DELETE,
TRACE, CONNECT)
url URL to work with
body Request body
headers Additional request headers (keyword=value)
optional arguments:
-h, --help show this help message and exit
-t, --terse Only show the response body
Metadata
Release files for httpcli 1.3.0
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 | |
|---|---|---|---|---|
| httpcli-1.3.0.tar.gz | 3.4 kB | Without provenance | Details |
Release files / httpcli-1.3.0.tar.gz
| Download URL | httpcli-1.3.0.tar.gz |
|---|---|
| Size | 3.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
37c1b653adbfbf4dac3e790f6ca442e9693e6758e012be74106434be8094f855
|
|
BLAKE2b-256 checksum How to use checksums |
90e94b89ecc8b599e832d5f0dd07495aba4e91de1892bbb4e04d141d720a2bd5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for httpcli 1.3.0
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.