HTTP Redirect
- 1 Overview
- 1.1 Policy Execution Order
- 1.2 Architecture
- 1.3 Limitations
- 2 Settings
Overview
Use this policy to manage HTTP redirection for API requests. When an HTTP response status is returned with a 3xx HTTP status code, the client side handles the redirect as defined in the policy.
Policy Execution Order
Transformation of request headers works in the following policy sequence for both APIs and Proxies:
Authorize By Role ➡️ Authentication Policy ➡️ Traffic Policy ➡️ HTTP Redirect
Expression Enabled Fields in API Policies
All expression-enabled fields take expressions from the SnapLogic Expression Language and the API Policy Manager functions.
Architecture
For this article, 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 policy 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.
Settings
Parameter Name | Description | Default Value |
---|---|---|
Label | Required. The name for the API policy. | HTTP Redirect |
When this policy should be applied | An expression enabled field that determines the condition to be fulfilled for the API policy to execute. For example, if the value in this field is | N/A |
HTTP Redirect Properties | The controls for HTTP redirection. Click to add redirect properties to the policy. Each property defines a condition to return a HTTP redirect response. Each property also include fields for specifying the redirect URL, content-type, and message body for the HTTP response. To remove the redirect property, click - and click Validate and Save. | N/A |
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. Note: Deselecting this checkbox does not remove the redirect property. | N/A |
Condition* | Enter an expression to prompt an HTTP redirect when it evaluates to | N/A |
Response Status* | Select one of the following:
| N/A |
Redirect URL | Click to specify an expression to build a valid URL. 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: | N/A |
Content-Type | Click to specify a function. For expressions containing a semi-colon ( 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:
| N/A |
Message Body | Enter a message for the API caller. Example: {
"Hello":"World"
} | N/A |
Status | Specifies whether the API policy is enabled or disabled. | Enabled |
Have feedback? Email documentation@snaplogic.com | Ask a question in the SnapLogic Community
© 2017-2024 SnapLogic, Inc.