Function: request()
function request(
path: string,
params: RequestParams,
autoLogoutOnAuthError: boolean,
useCluster: boolean,
queryParams?: QueryParameters): Promise<any>
Sends a request to the backend. If the useCluster parameter is true (which it is, by default), it will be treated as a request to the Kubernetes server of the currently defined (in the URL) cluster.
Parameters
| Parameter | Type | Default value | Description |
|---|---|---|---|
path | string | undefined | The path to the API endpoint. |
params | RequestParams | {} | Optional parameters for the request. |
autoLogoutOnAuthError | boolean | true | Whether to automatically log out the user if there is an authentication error. |
useCluster | boolean | true | Whether to use the current cluster for the request. |
queryParams? | QueryParameters | undefined | Optional query parameters for the request. |
Returns
Promise<any>
A Promise that resolves to the JSON response from the API server.
Throws
An ApiError if the response status is not ok.