Skip to content
/ hrun Public

HTTP request runner with a simple DSL based on JavaScript.

License

Notifications You must be signed in to change notification settings

speier/hrun

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

hrun

HTTP request runner with a simple DSL based on JavaScript.

Install

Download the latest release

or install using GoBinaries:

$ curl -sf https://gobinaries.com/speier/hrun | sh

Usage example

Create a script:

const host = 'https://httpbin.org'

GET(`${host}/get`)
POST(`${host}/post`, 'Accept: application/vnd.foobar.v2+json', { payload: { data: 'foobar' }})

Run the script:

$ hrun examples/basic.js

API

All HTTP method is a function with an URL, headers and payload arguments:

METHOD(URL, [headers], [payload])

URL: required

[headers]: optional

[payload]: optional

CLI

The following flags are available:

-e: set env var, key=value or filename (repeatable)

For example:

$ hrun -e=1 -e=2 -e bar.env foo.js

Flag -e is repeatable and can be key=value or a filename to load env vars, will be available on env object from the scripts.

License

MIT

About

HTTP request runner with a simple DSL based on JavaScript.

Resources

License

Stars

Watchers

Forks

Packages

No packages published