Custom Response
Overview
The custom-response
policy action returns a hard-coded response back to the client that made a request to your endpoint.
Behavior
When executed as an inbound policy, this action bypasses the upstream server and immediately returns to the caller with the configured response. When executed as an outbound policy, the response from the upstream server is overwritten with the configured response.
In both cases, if this action is executed, no further actions or policies in the policy configuration will be executed.
Configuration
Parameter | Description |
---|---|
status_code | The status code of the response. |
content_type | The content type of the response body, which will be set on the Content-Type header. Required if content is set. |
content | The body of the response. |