https://github.com/bbonnin/h
Simple CLI to query HTTP endpoints
https://github.com/bbonnin/h
cli curl hacktoberfest http wget
Last synced: 4 months ago
JSON representation
Simple CLI to query HTTP endpoints
- Host: GitHub
- URL: https://github.com/bbonnin/h
- Owner: bbonnin
- License: mit
- Created: 2019-02-18T12:20:39.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2023-03-04T03:10:08.000Z (over 2 years ago)
- Last Synced: 2025-06-04T22:52:04.717Z (4 months ago)
- Topics: cli, curl, hacktoberfest, http, wget
- Language: JavaScript
- Homepage:
- Size: 432 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# H
> Simple CLI to query HTTP endpoints.
## Install
```bash
npm i -g http-request-cli
```> Now you have `h` as a command to query http endpoint in your terminal.
## Usage
```bash
Usage: h [options] [command]Options:
-V, --version output the version number
-v, --verbose Verbose mode
--no-color Monochrome display
-o, --output Save response to a file
-y, --yaml Render JSON data in a coloured YAML-style
-H, --header Set a header (default: {})
-d, --data [data] Content of request
-D, --datafile
-t, --type Content type
-c, --cookie Cookie file
-h, --help output usage informationCommands:
get [options] Send a GET request
post [options] Send a POST request
put [options] Send a PUT request
delete [options] Send a DELETE request
patch [options] Send a PATCH request
head [options] Send a HEAD request
```## Examples
* Simple GET request
```bash
h get https://jsonplaceholder.typicode.com/todos/1
```
* GET request with response formatted as YAML
```bash
h get https://jsonplaceholder.typicode.com/todos/1 -y
```
* POST request with data provided as JSON
```bash
h post https://jsonplaceholder.typicode.com/posts -d '{"name":"bob"}'
```
* POST request with data provided as properties and converted into JSON
```bash
h post https://jsonplaceholder.typicode.com/posts -d name=alice
```
## TODO
* Automatic save of binary files (images, pdf, ...)
* Proxy support [first version: to be largely tested]
* Other types of authentication
* Progress bar