https://github.com/yuzuy/gurl
gurl is an HTTP client in CLI written in Go
https://github.com/yuzuy/gurl
cli command-line curl go golang http
Last synced: 13 days ago
JSON representation
gurl is an HTTP client in CLI written in Go
- Host: GitHub
- URL: https://github.com/yuzuy/gurl
- Owner: yuzuy
- License: mit
- Created: 2021-02-26T10:36:16.000Z (almost 5 years ago)
- Default Branch: main
- Last Pushed: 2021-04-17T07:32:44.000Z (almost 5 years ago)
- Last Synced: 2024-06-20T22:32:58.752Z (over 1 year ago)
- Topics: cli, command-line, curl, go, golang, http
- Language: Go
- Homepage:
- Size: 59.6 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# gurl
gurl is an HTTP client written in Go
## Installation
```
go get github.com/yuzuy/gurl/cmd/gurl
```
## Usage
### HTTP Request
```bash
gurl http://localhost:8080/v1/hello
```
#### Flags and Options
- -d - Input the request body
- -H - Input the request header
- -L - Follow redirects
- -u - Input username and password for Basic Auth
- -v - Output the verbose log
- -X - Input the http method
### Default header
gurl allows you to set the default header.
If you input the header that has the same key as the default header, override the default header.
```bash
gurl dh add localhost:8080 "Authorization:Bearer foobar"
gurl dh list
# Output:
# localhost:8080:
# Authorization: Bearer foobar
gurl http://localhost:8080 # == gurl -H "Authorization:Bearer foobar" http://localhost:8080
gurl dh rm localhost:8080 Authorization
gurl dh list localhost:8080
# Output:
# localhost:8080:
# pattern matching
gurl dh add "localhost:8080/v1/*" "Authorization:Bearer fizzbuzz"
gurl http://localhost:8080/v1/foo # == gurl -H "Authorization:Bearer fizzbuzz" http://localhost:8080/v1/foo
gurl http://localhost:8080 # == gurl http://localhost:8080
# endpoint
gurl dh add localhost:8080/v1/bar "Authorization:Bearer yuzuy"
gurl http://localhost:8080/v1/bar # == gurl -H "Authorization:Bearer yuzuy" http://localhost:8080/v1/bar
gurl http://localhost:8080/v1/bar/foo # == gurl -H "Authorization:Bearer fizzbuzz" http://localhost:8080/v1/bar/foo
```