-
Notifications
You must be signed in to change notification settings - Fork 1k
Open
Description
Specifically, I want to add some X-headers to the request made after the auth dance has been done. As it is, I can't: using client.Do() just throws away all the work done. and client.Post (or Get) does not allow for header mix-in. Unless there is a way to do this and I just can't find it in the docs?
My current code, adjusted for brevity:
ctx := context.Background()
conf := &clientcredentials.Config{
ClientID: "some ID",
ClientSecret: "some Secret",
TokenURL: "https://thatserver/api/v1/oauth2/token",
}
client := conf.Client(ctx)
rqbody := strings.NewReader("mybody{}")
// ***HERE***
res, err := client.Post("https://thatserver/superapi/?includes=B4181000", "application/json", rqbody)
// ... handle error, parse response etc.
At the ***HERE***
mark is where I'd expect to be able to add more headers. Returning an error if I try to clobber any of the headers OAuth2 needs is fine.
Metadata
Metadata
Assignees
Labels
No labels