File tree 3 files changed +12
-0
lines changed 3 files changed +12
-0
lines changed Original file line number Diff line number Diff line change
1
+ ## v0.11.0 (2024-04-09)
2
+ - ** Feature:** Add method ` WithCaptureHTTPRequest ` to package ` runtime ` , which allows capture of HTTP requests for debugging purposes.
3
+
1
4
## v0.10.1 (2024-03-20)
2
5
- ** Improvement:** Update ` ConfigureRegion ` method to take into account global servers without a region variable
3
6
Original file line number Diff line number Diff line change 52
52
53
53
// ContextHTTPResponse holds the raw HTTP response after the request has completed.
54
54
ContextHTTPResponse = contextKey ("httpResponse" )
55
+
56
+ // ContextHTTPRequest holds the raw HTTP request.
57
+ ContextHTTPRequest = contextKey ("httpRequest" )
55
58
)
56
59
57
60
// BasicAuth provides basic http authentication to a request passed via context using ContextBasicAuth
Original file line number Diff line number Diff line change @@ -12,3 +12,9 @@ import (
12
12
func WithCaptureHTTPResponse (parent context.Context , resp * * http.Response ) context.Context {
13
13
return context .WithValue (parent , config .ContextHTTPResponse , resp )
14
14
}
15
+
16
+ // WithCaptureHTTPRequest adds the raw HTTP request retrieval annotation to the parent context.
17
+ // After the request has completed, the req parameter will contain the raw HTTP request made to the API.
18
+ func WithCaptureHTTPRequest (parent context.Context , req * * http.Request ) context.Context {
19
+ return context .WithValue (parent , config .ContextHTTPRequest , req )
20
+ }
You can’t perform that action at this time.
0 commit comments