{% set_content_type %}

Use this tag to return a content type other than "text/html" in the HTTP response.

Syntax

{% set_content_type expression %}

Examples

Set content type with a string

Copy
{% set_content_type "application/xml" %}

Set content type by variable

Copy
{% var contenttype = "text/csv" %} {% set_content_type contenttype %}

Set content type by appending string

Copy
{% var contenttype = "csv" %} {% set_content_type "text/" | append: contenttype %}