ApiKeyProvider class
Provider that handles API Key authentication
Constructors
Api |
Methods
Add |
Adds authentication info to http requests |
Constructor Details
ApiKeyProvider(string, string, ApiKeyLocation)
new ApiKeyProvider(keyName: string, keyValue: string, keyLocation: ApiKeyLocation)
Parameters
- keyName
-
string
The name of request header or query parameter that specifies API Key
- keyValue
-
string
The value of API Key
- keyLocation
- ApiKeyLocation
The location of API Key: request header or query parameter.
Method Details
AddAuthenticationInfo(AxiosRequestConfig<any>)
Adds authentication info to http requests
function AddAuthenticationInfo(config: AxiosRequestConfig<any>): Promise<AxiosRequestConfig<any>>
Parameters
- config
-
AxiosRequestConfig<any>
Contains all the request information and can be updated to include extra authentication info. Refer https://axios-http.com/docs/req_config for detailed document.
Returns
Promise<AxiosRequestConfig<any>>
Updated axios request config.