If you do not have Go installed, Install a prebuilt binary from releases.
If you have the GO version >= 1.16 installed:
```
$ git clone https://github.com/redtrib3/gurl.git
$ cd gurl
$ go get
$ go build
```
Or
```
go install github.com/redtrib3/gurl@latest
```
Information on usage can be found by using --help/-h flag.
./gurl --help
Usage gurl [options...]
flag defaults description
---- -------- ----------
-H | | Specify Header separated by colon (multiple Headers are allowed)
-c | false | prints colored/syntax highlighted response body.
-data | | Specify POST data (form-data/JSON)
-m | GET | Specify the request Method (GET, POST, PUT, DELETE, PATCH)
-o | | Save response to a file.
-pprint | false | Pretty print JSON response
-proxy | | Specify Proxy URI in format -> [protocol]://host[:port]
-quiet | false | Supress explicit Warning/Info messages.
-raw-request | false | Print request in raw format (with request headers and body)
-redirect | false | Follow redirects (disabled by default)
-u | | URL to remote/local endpoint
-upload-file | | Upload file to remote endpoint. (default method - PUT)
Send a GET request:
gurl -u https://example.com/
- Send a GET request with Header:
gurl -u https://example.com/test?uname=123 -H "X-Custom-Header 123"
- Multiple Headers:
gurl -u http://example.com -H "Header1:test" -H "Header2:test"
Send POST requests :
gurl -u https://login.com/ -m POST -data "username=test&password=summer123!"
gurl -u https://login123.com/ -m POST -data '{"username":"test", "password": "pass123"}'
Other examples:
gurl -u https://transfer.sh/test -upload-file ~/test.txt