File tree Expand file tree Collapse file tree 1 file changed +20
-1
lines changed Expand file tree Collapse file tree 1 file changed +20
-1
lines changed Original file line number Diff line number Diff line change @@ -37,7 +37,26 @@ err := request.Do(params, result)
37
37
```
38
38
All parameters besides the ` URL ` and the ` Method ` are optional and can be omitted.
39
39
40
- If you want to retrieve the response body as a string, e.g. for debugging or testing purposes, you can use ` DoWithStringResponse ` instead.
40
+ ### Accessing the response headers
41
+ If you need access to the headers of the http response, you can initialize a header map and pass it as a third argument to ` Do ` .
42
+ It will then be populated with the response headers that the server returns.
43
+
44
+ ``` go
45
+ responseHeaders := http.Header {}
46
+ err := request.Do (params, result, responseHeaders)
47
+ ```
48
+
49
+ ### Using a custom http client
50
+ If you want to supply a custom http client to use for the request, you can use ` DoWithCustomClient ` .
51
+ The client needs to be of type ` *http.Client ` .
52
+
53
+ ``` go
54
+ err := request.DoWithCustomClient (params, result)
55
+ ```
56
+
57
+ ### Retrieving the response as a string
58
+ If you want to retrieve the response body as a string, e.g. for debugging or testing purposes, you can use ` DoWithStringResponse ` .
59
+
41
60
``` go
42
61
result , err := request.DoWithStringResponse (params)
43
62
```
You can’t perform that action at this time.
0 commit comments