Response Transformer rule

Transforms response headers from external endpoints before sending the response to the client. You can add, remove, or modify external endpoint response headers.

Rule requirements

This rule only applies to external endpoints.

Rule execution order

Transformation of response headers runs after the response is received from the external endpoint. This rule runs with the Response Mapper.

Note: All expression enabled fields take expressions from the SnapLogic Expression Language and the API Rule Manager functions.

The Response Mapper and Response Transformer rules support the request and response functions in the APIM Expression Language. These functions enable you to modify the headers for your Proxy endpoints quickly. When you click to enable the expression dropdown, you can access these functions.

Settings

Field Description
When this rule should be applied An expression that defines one or more conditions that must be true for the rule to execute.

Example: The expression request.method == "POST" causes the rule to execute only on POST requests.

Headers to Add/Replace

The list of headers to add or replace into the response.

If the name or value of an entry in the table is blank, no changes are made.

Name The name for the header to add or replace.

Example: X-content-type-options

Value

The value for the header. If this field is an expression, it can return a list to simulate the header being repeated multiple times in the original response.

If the header in the original response was repeated multiple times, this new value replaces all of the original values. If the original values need to be preserved, this field should be an expression that gets the original value and returns a modified version.

Example: nosniff

Headers to Remove

The list of headers to remove from the response.

The subfield Name functions the same way it does for Headers to Add/Replace.

Example: x-content-age

Note: Use '-' (dash) instead of '_' (underscore) in header name as '_' is ignored and the header is not captured. '-' is internally transformed to '_' for you to map to the Pipeline parameter. For example, HTTP-ACCEPT instead of HTTP_ACCEPT.