Skip to content
This repository was archived by the owner on Jun 21, 2022. It is now read-only.

Commit 91831c5

Browse files
committed
documentation for http.RoundTripper
1 parent 7d4c64b commit 91831c5

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

README.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,26 @@ response2, err := dr.Execute()
2222

2323
// check error, get response
2424
```
25+
26+
Or you can use it with `http.Request`
27+
28+
```go
29+
t := dac.NewTransport(username, password)
30+
req, err := http.NewRequest(method, uri, payload)
31+
32+
if err != nil {
33+
log.Fatalln(err)
34+
}
35+
36+
resp, err := t.RoundTrip(req)
37+
if err != nil {
38+
log.Fatalln(err)
39+
}
40+
41+
fmt.Println(resp)
42+
```
43+
44+
2545
# Todos
2646

2747
* Unit testing

0 commit comments

Comments
 (0)