Skip to content

Commit

Permalink
fix README
Browse files Browse the repository at this point in the history
  • Loading branch information
imroc committed Nov 15, 2017
1 parent 6483cb1 commit 2b1eb5e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ req.Get("https://www.baidu.com", header)
```

## <a name="Set-Param">Set Param</a>
Use `req.Param` (it is actually a `map[string]string`)
Use `req.Param` (it is actually a `map[string]interface{}`)
``` go
param := req.Param{
"id": "imroc",
Expand All @@ -114,7 +114,7 @@ param := req.Param{
req.Get("http://foo.bar/api", param) // http://foo.bar/api?id=imroc&pwd=roc
req.Post(url, param) // body => id=imroc&pwd=roc
```
use `req.QueryParam` force to append params to the url (it is also actually a `map[string]string`)
use `req.QueryParam` force to append params to the url (it is also actually a `map[string]interface{}`)
``` go
req.Post("http://foo.bar/api", req.Param{"name": "roc", "age": "22"}, req.QueryParam{"access_token": "fedledGF9Hg9ehTU"})
/*
Expand Down
4 changes: 2 additions & 2 deletions doc/README_cn.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ req.Get("https://www.baidu.com", header)
```

## <a name="Set-Param">设置请求参数</a>
Use `req.Param` (它实际上是一个 `map[string]string`)
Use `req.Param` (它实际上是一个 `map[string]interface{}`)
``` go
param := req.Param{
"id": "imroc",
Expand All @@ -107,7 +107,7 @@ param := req.Param{
req.Get("http://foo.bar/api", param) // http://foo.bar/api?id=imroc&pwd=roc
req.Post(url, param) // 请求体 => id=imroc&pwd=roc
```
使用 `req.QueryParam` 强制将请求参数拼在url后面 (它实际上也是一个 `map[string]string`)
使用 `req.QueryParam` 强制将请求参数拼在url后面 (它实际上也是一个 `map[string]interface{}`)
``` go
req.Post("http://foo.bar/api", req.Param{"name": "roc", "age": "22"}, req.QueryParam{"access_token": "fedledGF9Hg9ehTU"})
/*
Expand Down

0 comments on commit 2b1eb5e

Please sign in to comment.