Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
guonaihong authored Oct 8, 2019
1 parent a7d145d commit 597e2be
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ SetHeader([]string{"active", "enable", "action", "drop"})
// 设置string变量至请求的http body
err := gout.New(nil).POST(url).SetBody("hello world"/*更多支持类型请看下面*/).Do()
// 设置实现io.Reader接口的变量 请求的http body
// 设置实现io.Reader接口的变量至 请求的http body
err = gout.POST(url).SetBody(bytes.NewBufferString("hello world")).Code(&code).Do()
```
#### bindBody
Expand All @@ -203,7 +203,8 @@ var s string
err := gout.New(nil).GET(url).BindBody(&s/*更多支持指针类型变量请看下面*/).Do()
// 解析http body至实现io.Writer接口的变量里面
err = New(nil).GET(ts.URL + v.url).BindBody(v.got).Code(&code).Do()
var b bytes.Buffer{}
err = gout.GET(url).BindBody(&b).Code(&code).Do()
```
#### 支持的类型有
* io.Reader(SetBody 支持)
Expand Down

0 comments on commit 597e2be

Please sign in to comment.