Skip to content

bbonnin/h

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

34 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

H

Simple CLI to query HTTP endpoints.

Install

npm i -g http-request-cli

Now you have h as a command to query http endpoint in your terminal.

Usage

Usage: h [options] [command]

Options:
  -V, --version               output the version number
  -v, --verbose               Verbose mode
  --no-color                  Monochrome display
  -o, --output <file name>    Save response to a file
  -y, --yaml                  Render JSON data in a coloured YAML-style
  -H, --header <name=value>   Set a header (default: {})
  -d, --data [data]           Content of request
  -D, --datafile <file name>  
  -t, --type <content type>   Content type
  -c, --cookie <cookie file>  Cookie file
  -h, --help                  output usage information

Commands:
  get <url> [options]         Send a GET request
  post <url> [options]        Send a POST request
  put <url> [options]         Send a PUT request
  delete <url> [options]      Send a DELETE request
  patch <url> [options]       Send a PATCH request
  head <url> [options]        Send a HEAD request

Examples

  • Simple GET request
h get https://jsonplaceholder.typicode.com/todos/1

simple query

  • GET request with response formatted as YAML
h get https://jsonplaceholder.typicode.com/todos/1 -y

simple query yaml

  • POST request with data provided as JSON
h post https://jsonplaceholder.typicode.com/posts -d '{"name":"bob"}'

post json

  • POST request with data provided as properties and converted into JSON
h post https://jsonplaceholder.typicode.com/posts -d name=alice

post props

TODO

  • Automatic save of binary files (images, pdf, ...)
  • Proxy support [first version: to be largely tested]
  • Other types of authentication
  • Progress bar

About

Simple CLI to query HTTP endpoints

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •