NewTokenClient returns an [http.Client] that sets the bearer token in the Authorization header of all requests.
(token string)
| 16 | // NewTokenClient returns an [http.Client] that sets the bearer token in the |
| 17 | // Authorization header of all requests. |
| 18 | func NewTokenClient(token string) *http.Client { |
| 19 | return &http.Client{ |
| 20 | Transport: &tokenRoundTripper{ |
| 21 | base: http.DefaultTransport, |
| 22 | token: token, |
| 23 | }, |
| 24 | } |
| 25 | } |
no outgoing calls