HTTP Redirect rule
Use this rule to manage HTTP redirection for API requests
Rule Execution Order
Transformation of request headers works in the following rule sequence for both APIs and Proxies:
Authorize By Role ➡️ Authentication rule ➡️ Traffic rule ➡️ HTTP Redirect
Architecture
In this context, the client side is called the user-agent. For APIM, the user-agent might be a web browser, HTTP client, or cURL application. Since the user-agent is responsible for handling the response, the rule assumes that the user-agent (and not the server) performs the redirects; this includes processing follow-on HTTP methods, payload content, and redirect addresses. The server (Snaplex) is only responsible for setting the Response status type, status code, location header, and, where defined, the message content.

Limitations
Only message bodies for application/json
and application/xml
content types are validated by the UI.
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.
Default value: N/A Example: The expression |
HTTP Redirect Properties | The controls for HTTP redirection. Each property defines a condition to return a
HTTP redirect response. Each property also includes fields for specifying the
redirect URL, content-type, and message body for the HTTP response. Click |
Use User-Agent Content | Select this checkbox to redirect an HTTP user-agent with the user-agent’s
original request contents, such as the content type, message body, and query
parameters. Tip: Deselecting this checkbox does not remove the redirect
property.
Default status: Deselected |
Condition | Required. Enter an expression to prompt an HTTP redirect
when it evaluates to True . An expression that evaluates to
False will not prompt an HTTP redirect response. Default value: N/A |
Response Status | Required. Select one of the following:
Default value: 300 - Multiple Choices |
Redirect URL | Click Note:
Some functions in the dropdown list might not be applicable and therefore will not work. Alternatively, you can disable the Expression field to enter the URL for the redirection. Example: Default value: N/A |
Content-Type | Click escape() to allow the expression to compile. For example:
escape("text/xml; charset=utf-8")
You can add other content types recognized by IANA, such as: Note:
Some functions in the dropdown list might not be applicable and therefore will
not work.Alternatively, select the content type from the dropdown:
Default value: N/A |
Message Body | Enter a message for the API caller. Example:
Default value: N/A |
Description |
Required. Default value: Requests that meet the criteria are being redirected according to the specified rules Example: HTTP redirection scheme |