RequestHelper
The RequestHelper offers functionality needed when working with requests.
import { RequestHelper } from '@archibald/core';
getRequestHeader
This method get request header. In case there is more than one value, then only the first is returned.
import { RequestHelper } from '@archibald/core';
const header = RequestHelper.getRequestHeader(PARAMETERS);
Parameters
| Name | Type | Description |
|---|---|---|
| requestHeaders | DefaultHeader | An object containing request headers. |
| name | string | The name of a request header. |
getRequestSearchParams
This method returns search parameters from request.
import { RequestHelper } from '@archibald/core';
const searchParams = RequestHelper.getRequestSearchParams(PARAMETERS);
Parameters
| Name | Type | Description |
|---|---|---|
| request | Request | An object containing search params. The Request object comes from @hapi/hapi package. |
getAppConfig
This method gets application Api configuration and also sets them with environment overrides.
import { RequestHelper } from '@archibald/core';
const appConfig = RequestHelper.getAppConfig(PARAMETERS);
Parameters
| Name | Type | Description |
|---|---|---|
| clientConfig | DefaultAppConfig | Representation of client configuration. |
getServerConfig
This method gets server api configuration and also sets them with environment overrides.
import { RequestHelper } from '@archibald/core';
const hybrisConfig = RequestHelper.getServerConfig(PARAMETERS);
Parameters
| Name | Type | Description |
|---|---|---|
| serverConfig | DefaultConfig | Representation of an environment configuration. |