restme
v1.0.9
Published
A node.js cli to make http requests easy.
Downloads
17
Maintainers
Readme
restme
Restme is an easy way to execute requests in terminal. Instead of use the classic curl, why don't use a simpler cli?
Version
1.0.9
Installation
$ [sudo] npm i -g restme
Try it now! (with chuck norris API :P)
$ restme http://api.icndb.com/jokes/random
Awesome uh?
Simple example
$ restme https://someurl.com
Simple example, without protocol (default is http://)
$ restme someurl.com
Using convenience -j or --json option to auto include Accept: application/json
$ restme https://someurl.com/post/1 -j
Raw mode! If you don't want pretty json responses
$ restme https://someurl.com -r [or --raw]
Use other request method (default is GET)
$ restme DELETE https://someurl.com/post/1
Adding some headers
$ restme https://someurl.com/post/1 -H "Accept: application/json, X-Token: XXXXXXXXXX" [or --header]
Posting serialized data
$ restme POST https://someurl.com/post/1 -f "name=foo&password=bar"[or --form]
Posting JSON data
$ restme POST https://someurl.com/post/1 -d '{"name":"foo", "password": "bar" }'[or --data]
Using basic auth
$ restme https://someurl.com/auth -a user@password [or --auth]
Only returns the headers (curl -I equivalent)
$ restme https://www.someurl.com -I
Only returns the body
$ restme https://www.someurl.com -B
Akamai debug mode!
$ restme https://www.someurl.com --akamai
Timeout to requests
$ restme https://www.someurl.com -m 2 [or --max-time]
Putting all together
$ restme https://someurl.com.br -j -H "X-Token: XXXXXXXXX" -r -a user@password
Still want to help?
$ restme -h [--help]
Todo's
- Write Tests (shame on me)
- Add more and more helpful options
- Add Code Comments
- Write the code in ES6 (?)
- Plz, suggests
License
MIT