{% set_response_code %}

Use this tag to set a custom HTTP response code.

Syntax

{% set_response_code status_code ["status_message"] %}

Status_code must be an integer between 100 and 599 in order to be valid. You may include variables filters, etc.. in the status message if desired.

Examples

{% var objectType = "teapot" %}
{% set_response_code 418 objectType | prepend: "I'm a " %}
{% set_response_code 404 %}

Developer Overview

Liquid Markup