Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/thesurlydev/httpp
A minimal representation of HTTP requests and a reference CLI tool.
https://github.com/thesurlydev/httpp
curl http http-client json-schema rust
Last synced: about 1 month ago
JSON representation
A minimal representation of HTTP requests and a reference CLI tool.
- Host: GitHub
- URL: https://github.com/thesurlydev/httpp
- Owner: thesurlydev
- Created: 2024-10-18T19:31:17.000Z (3 months ago)
- Default Branch: main
- Last Pushed: 2024-11-25T18:59:25.000Z (about 1 month ago)
- Last Synced: 2024-11-25T19:42:37.711Z (about 1 month ago)
- Topics: curl, http, http-client, json-schema, rust
- Language: Rust
- Homepage:
- Size: 27.3 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# httpp
`httpp` is:
1. A minimal structured file format to represent HTTP requests. See the [schema](schema.json) for details.
2. A reference CLI tool which can execute requests defined in the `httpp` format.## Why
HTTP is a simple protocol, but there isn't a simple way to represent HTTP requests in a structured format.
Existing formats like HAR are too verbose and complex for simple use cases.
`httpp` aims to be a simple and minimal format to represent HTTP requests that aren't tied to a specific tool like
Postman or curl.## Usage
```
Usage: httpp [OPTIONS]Options:
-f, --file Read the request from a file
--curl Convert the request to a curl command
-s, --status Output the response status code
-H, --headers Output the response headers
-b, --body Output the response body
-o, --output Specify output format (json or text) [default: text]
-h, --help Print help
-V, --version Print version
```Some examples...
You can pass a `httpp` file to the CLI with the `-f` flag:
```
httpp -f get-request.json
```or you can pipe the `httpp` file to the CLI:
```
cat get-request.json | httpp
```If you're just interested in the response status code, you can use the `-s` flag:
```
httpp -f get-request.json -s
```To output everything in the response (status, headers, and body):
```
httpp -f get-request.json -sHb
```Finally, to convert a `httpp` request to a curl command, you can use the `--curl` flag:
```
httpp -f get-request.json --curl
```