superagent-cli

2.1.0 • Public • Published

Super Agent CLI

Travis CI Badge

A command line interface for the superagent rest library. Designed to make testing JSON apis from the command line easier.

to install:

npm install -g superagent-cli

the super agent cli command is superagent and requests look like the following:

superagent or superagent -h to display help
superagent <url> <rest method(get|post|put|patch|delete)> <json data>
superagent www.google.com
superagent www.google.com get
superagent localhost:3000 post '{"hello":"world"}'
superagent localhost:3000 post {hello: \'world\'}

Note: if using javascript literal notation (instead of fully qualified JSON) all quotes around string must be escaped ex: {hello: 'world'} must actually be hello: \'world\' or use two sets of quotes {hello: "'super world'"} which will keep white space the same

superagent-cli can also add basic HTTP Auth to any request with with -u username:password

superagent -u username:password localhost:3000

superagent-cli can read json data from a file using the -f parameter.

superagent example.com/test post -f request_body.json

superagent-cli can set arbitrary headers with -H

superagent -H "Accept: text/plain, X-Arbitrary-Header: true" example.com

Readme

Keywords

Package Sidebar

Install

npm i superagent-cli

Weekly Downloads

1

Version

2.1.0

License

none

Last publish

Collaborators

  • toastynerd