Following up on #522, where we discussed making it easier to modify HTTP client transport requests, for example by adding headers, we propose the following two new options:
type StreamableClientTransport struct {
...
// If set, ModifyRequest is called before each outgoing HTTP request made by the client
// connection. It can be use to, for example, add headers to outgoing requests.
ModifyRequest func(*http.Request)
}
type SSEClientTransport struct {
...
// <ditto>
ModifyRequest func(*http.Request)
}
We believe these options will make it easier to do things like add auth headers. Currently, this can be achieved using the HTTPClient field, but only in the roundtripper, which requires cloning the request.
Following up on #522, where we discussed making it easier to modify HTTP client transport requests, for example by adding headers, we propose the following two new options:
We believe these options will make it easier to do things like add auth headers. Currently, this can be achieved using the
HTTPClientfield, but only in the roundtripper, which requires cloning the request.