NewApiKeyHeaderAuthHTTPClient returns a new http client, with automatic API key authentication. Specifically this means that the client will automatically add the API key (as a header) to every request. HeaderValue must be in the correct format. This sometimes means adding prefix to the API Key.
( //nolint:ireturn ctx context.Context, headerName, headerValue string, opts ...HeaderAuthClientOption, )
| 10 | // add the API key (as a header) to every request. |
| 11 | // HeaderValue must be in the correct format. This sometimes means adding prefix to the API Key. |
| 12 | func NewApiKeyHeaderAuthHTTPClient( //nolint:ireturn |
| 13 | ctx context.Context, |
| 14 | headerName, headerValue string, |
| 15 | opts ...HeaderAuthClientOption, |
| 16 | ) (AuthenticatedHTTPClient, error) { |
| 17 | return NewHeaderAuthHTTPClient(ctx, append(opts, WithHeaders(Header{ |
| 18 | Key: headerName, |
| 19 | Value: headerValue, |
| 20 | }))...) |
| 21 | } |
| 22 | |
| 23 | // NewApiKeyQueryParamAuthHTTPClient returns a new http client, with automatic API key |
| 24 | // authentication. Specifically this means that the client will automatically |