A command line tool for sending HTTP requests and displaying the response.
The first need Go installed (version 1.22+ is required), then you can use the below
command to install rest-client
.
go install github.com/no-src/rest-client/...@latest
Create a conf.yaml
file to define the custom variables, it is optional.
host: http://127.0.0.1
secret: 123456
Create a request.http
file to define the HTTP requests, it is required.
### Test POST HTTP Request
POST {{host}}/say
Content-Type: application/json
{
"content": "hello",
"secret": "{{secret}}"
}
### Test GET HTTP Request
GET {{host}}/info
rc -conf=conf.yaml -http=request.http
rc -conf=conf.yaml -http=request.http -run -id=1