micnncim / yreq

Send multiple HTTP POST requests by JSON using YAML file

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

yreq

Release Go Report Card Maintainability CodeFactor Codacy Badge MIT

yreq is a tool sending multiple HTTP POST requests by JSON using YAML file.

Usage

$ yreq -f example.yaml -url <ENDPOINT>

Installation

Homebrew

$ brew install micnncim/tap/yreq

go get

$ go get github.com/micnncim/yreq/cmd/yreq

Example

Both of requests and responses are written by YAML.

- name: Alice
  email: alice@mail.com
  task:
    - title: Walking
      desc: Daily work out
    - title: Study Japanese
- name: Bob
  email: bob@mail.net
  task:
    - title: Swiming
      desc: Daily work out

It is equivalent to the following JSONs.

{
  "email": "alice@mail.com",
  "name": "Alice",
  "task": [
    {
      "desc": "Daily work out",
      "title": "Walking"
    },
    {
      "title": "Study Japanese"
    }
  ]
}
{
  "email": "bob@mail.net",
  "name": "Bob",
  "task": [
    {
      "desc": "Daily work out",
      "title": "Swimming"
    }
  ]
}

LICENSE

MIT

About

Send multiple HTTP POST requests by JSON using YAML file

License:MIT License


Languages

Language:Go 100.0%