File tree Expand file tree Collapse file tree 1 file changed +24
-0
lines changed
Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -242,6 +242,30 @@ client.Runners.New(
242242)
243243```
244244
245+ ### Accessing raw response data (e.g. response headers)
246+
247+ You can access the raw HTTP response data by using the ` option.WithResponseInto() ` request option. This is useful when
248+ you need to examine response headers, status codes, or other details.
249+
250+ ``` go
251+ // Create a variable to store the HTTP response
252+ var response *http.Response
253+ runner , err := client.Runners .New (
254+ context.TODO (),
255+ gitpod.RunnerNewParams {
256+ ConnectProtocolVersion : gitpod.F (gitpod.RunnerNewParamsConnectProtocolVersion1 ),
257+ },
258+ option.WithResponseInto (&response),
259+ )
260+ if err != nil {
261+ // handle error
262+ }
263+ fmt.Printf (" %+v \n " , runner)
264+
265+ fmt.Printf (" Status Code: %d \n " , response.StatusCode )
266+ fmt.Printf (" Headers: %+#v \n " , response.Header )
267+ ```
268+
245269### Making custom/undocumented requests
246270
247271This library is typed for convenient access to the documented API. If you need to access undocumented
You can’t perform that action at this time.
0 commit comments