◆ constructHeaders()
SetHeadersElement::constructHeaders | ( | pipeline | ) |
Construct the headers and their properties which can be set by the service.
An example of the structure of the headers is: { 'Accept-CH': { name: 'Accept-CH', properties: [ 'device.SetHeaderBrowserAccept-CH', 'device.SetHeaderPlatformAccept-CH', 'device.SetHeaderHardwareAccept-CH' ] } }
- Parameters
-
- {Pipeline} - pipeline: The pipeline instance to get the properties from.
- Returns
- {object} Collection of headers which can be set in the response.
◆ getHeaderName()
SetHeadersElement::getHeaderName ( propertyName ) inlineGet the name of the header which the property relates to.
- Parameters
-
- {string} - propertyName: To get the header name from.
- Returns
- {string} Header name.
◆ getResponseHeaders()
SetHeadersElement::getResponseHeaders ( flowData ) inlineGet response headers (e.g.
Accept-CH)
- Parameters
-
- {FlowData} - flowData: A processed FlowData instance to get the response header values from.
- Returns
- {object} A dictionary of response header names with their values if they are not null
◆ processInternal()
SetHeadersElement::processInternal ( flowData ) inlineAdd the response header dictionary to the FlowData.
- Parameters
-
- {FlowData} - flowData the FlowData being processed
◆ tryGetValue()
SetHeadersElement::tryGetValue ( flowData, elementKey, propertyKey ) inlineTry to get the value for the given element and property.
If the value cannot be found or is null/unknown, then undefined is returned.
- Parameters
-
- {FlowData} - flowData: A processed FlowData instance to get the value from.
- {string} - elementKey: Key for the element data to get the value from.
- {string} - propertyKey: Name of the property to get the value for.
- Returns
- {string | undefined} value string or undefined.