Skip to main content

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

NameTypeDescription
requestHeadersDefaultHeaderAn object containing request headers.
namestringThe name of a request header.

getRequestSearchParams

This method returns search parameters from request.

import { RequestHelper } from '@archibald/core';

const searchParams = RequestHelper.getRequestSearchParams(PARAMETERS);

Parameters

NameTypeDescription
requestRequestAn 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

NameTypeDescription
clientConfigDefaultAppConfigRepresentation 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

NameTypeDescription
serverConfigDefaultConfigRepresentation of an environment configuration.