Skip to content

Commit

Permalink
update doc
Browse files Browse the repository at this point in the history
  • Loading branch information
李曦赞 committed Apr 22, 2022
1 parent b2919d3 commit b8197df
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
13 changes: 7 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,16 @@ github.com/lxzan/hasaki

- Basic Usage
```go
// GET https://api.github.com/
// POST https://api.github.com/
hasaki.
Get("https://api.github.com/").
Post("https://api.github.com/").
Send(nil).
GetBody()
BindJSON()

// GET http://127.0.0.1:8080/server.php?hello%5B%5D=world&hello%5B%5D=%E8%BF%9E%E7%BB%AD%E6%80%A7&me=lxzan
// POST http://127.0.0.1:8080/server.php
hasaki.
Get("http://127.0.0.1:8080/server.php").
Post("http://127.0.0.1:8080/server.php").
SetEncoder(hasaki.FormEncoder).
Send(hasaki.Any{
"hello": []string{"world", "连续性"},
"me": "lxzan",
Expand All @@ -25,7 +26,7 @@ hasaki.

// POST
hasaki.
POST("http://127.0.0.1:9999/").
Post("http://127.0.0.1:9999/").
SetHeaders(hasaki.Form{
"X-Access-Token": token,
"X-Running-Env": env,
Expand Down
5 changes: 5 additions & 0 deletions client.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@ func (this *Client) SetTimeOut(d time.Duration) *Client {
return this
}

func (this *Client) SetTransport(transport *http.Transport) *Client {
this.cli.Transport = transport
return this
}

func (this *Client) SetProxyURL(url string) *Client {
urlProxy, err := neturl.Parse(url)
if err != nil {
Expand Down

0 comments on commit b8197df

Please sign in to comment.