HTTP request runner with a simple DSL based on JavaScript.
Download the latest release
or install using GoBinaries:
$ curl -sf https://gobinaries.com/speier/hrun | sh
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
All HTTP method is a function with an URL, headers and payload arguments:
METHOD(URL, [headers], [payload])
URL
: required
[headers]
: optional
[payload]
: optional
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.