brunodavi / brunodavi/http-script

[ FEATURE ] Make command line

Open
#16 0 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
JavaScript
Stars
3
Forks
1
PR merge metrics
No merged PRs in 30d

Description

**Is your feature request related to a problem? Please describe.**
I think it's bad to have to write the command in node directly.

**Describe the solution you'd like**
I would like to add a feature so that it can be used as a terminal program using an .hts file to make the entire request.

**Example**

```
http-script --help

Usage: http-script [options] file.hts [...args]
Tool to easily create http request scripts

-h --help -- view help
-J --no-js -- disable js eval

Examples:
http-script get-user-by-name.hts name=john
http-script --no-js get-token.hts
```

**Describe alternatives you've considered**
Something simpler

```
http-script get-token.hts
```

**Additional context**
Currently, if you want to make a request you have to do this:

```js
import httpScript from 'http-script'

function httpRequest() { ... }

const response = httpScript(
`
get :1234/users

.js
this.state.user = response.userList[3]
.

---

post /user/$user.id
`,
httpRequest
)
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.