LoadRESTHeaders method: IBInfo class

Syntax

LoadRESTHeaders()

Description

Use this method to load the headers defined on the appropriate routing for a REST-based service operation. Once loaded, the headers can be modified without specifying the connector override property.

The LoadRESTHeaders method is simply a way to pre-load the headers that you have defined on the Service Operation via the Routing Header Properties tab. Any response or request headers from a third party simply need to read those off the IBConnectorInfo object.

Parameters

None.

Returns

A Boolean value: True if the method executed successfully, False otherwise.

Note:

The connector override property does not need to be set when using LoadRESTHeaders.

Example

The following example demonstrates how you can modify HTTP headers through PeopleCode. In this example, the request on the subscribing node (the consumer) is modified.

Note:

No HTTP properties are currently applicable for REST and will be removed by Integration Broker.

&request = CreateMessage(Operation.MAPS_GET);

&bRet = &request.IBInfo.LoadRESTHeaders();

/* Add any additional headers not defined on the routing */
&bRet = &request.IBInfo.IBConnectorInfo.AddConnectorProperties("Content-⇒
Language", "eng", %HttpHeader);

The following example demonstrates how you can add HTTP headers to a REST-based service operation response within an OnRequest event:

&response = CreateMessage(Operation.WEATHERSTATION_GET, %IntBroker_Response);

&bRet = &response.IBInfo.LoadRESTHeaders();

/* Add or modify additional headers not defined on the routing */
&bRet = &response.IBInfo.IBConnectorInfo.AddConnectorProperties("Content-⇒
Language", "eng", %HttpHeader);

Return &response;