It is a curl but with json support
go install gcurl
it open json request file and do the request
Usage: gcurl file [file name] [flags]
Examples:
file contain example for get request
{
"method": "GET",
"url": "https://jsonplaceholder.typicode.com/todos/1",
"headers": {
"accept": "application/json",
}
}
file contain example for post request
{
"method": "POST",
"url": "https://jsonplaceholder.typicode.com/posts",
"headers": {
"accept": "application/json",
},
"body": {
"title": "foo",
"body": "bar",
"userId": 1
}
}
http get request
Usage: gcurl get [url] [flags]
Examples:
gcurl get -H '{"accept": "application/json"}' https://jsonplaceholder.typicode.com/todos/1
Flags: -H, --headers string headers
http post request
Usage: gcurl post [url] [flags]
Examples:
gcurl post -H '{"accept": "application/json"}' \
-B '{"title": "foo", "body": "bar", "userId": 1}' \
https://jsonplaceholder.typicode.com/posts
Flags:
-B, --body string body
-H, --headers string headers