In the previous time, I wrote raw HTTP request in a text and
sent it to server by nc tool to test my API.
This hard-core style do help me to understand HTTP proto. But
I think I could test API in a more effcient way.
One night I found a tool called httpie.
It’s awesome and convenient. So I gonna make a new httpie with
Golang. Only standard library, it’s a good way to learn Golang
for someone who new to Golang.
@licece: The MIT License
$ make clean $ make $ ./go-http httpbin.org/status/418
Generally, it looks like
host is empty, like
host is assumed as
- In default the go-http use GET method;
./go-http :8080 name:banana age:12to add your request-headers;
./go-http :8080 name=banana age=12to send JSON data in POST method;
./go-http :8080 name-banana age#12to send FORM data in POST method;