Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Latest commit

 

History

17 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

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

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages