Skip to content

Commit

Permalink
fix: docs (#27)
Browse files Browse the repository at this point in the history
* fix: docs

* fix: remove redundant right parenthesis

---------

Co-authored-by: wenchyzhu <[email protected]>
  • Loading branch information
wenchy and wenchyzhu authored Mar 12, 2024
1 parent 4c70274 commit f5dbba7
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ s := string(b)

```go
var txt string
r, err := requests.Get("http://example.com")
r, err := requests.Get("http://example.com",
requests.ToText(&txt))
if err != nil {
// ...
Expand Down Expand Up @@ -160,7 +160,7 @@ if err != nil {
}
req, err := http.NewRequestWithContext(
ctx, http.MethodGet,
u.String(), nil)
u.String(), nil)
if err != nil {
// ...
}
Expand All @@ -183,7 +183,7 @@ if err != nil {

```go
var res JSONResponse
r, err := requests.Post("http://example.com")
r, err := requests.Post("http://example.com",
requests.ToJSON(&res))
if err != nil {
// ...
Expand Down Expand Up @@ -233,10 +233,10 @@ if err != nil { /* ... */ }
// URL: http://example.com?a=1&b=2&c=3
```

### Dump outgoing client request and response
### Dump request and response

```go
var reqDump, respDump string
r, err := requests.Get("http://example.com",
requests.Dump(&request, &respDump))
requests.Dump(&reqDump, &respDump))
```

0 comments on commit f5dbba7

Please sign in to comment.