HTTP Response results
Ossi Galkin avatar
Written by Ossi Galkin
Updated over a week ago

Elements of types Return, Intermediate Return, and Throw have the option to return an HTTP Response result. This return type is used by HTTP and API Triggers to build the actual HTTP response that is returned to the caller.

Other Triggers, such as Queue Triggers, do not have any special handling for the HTTP return type. If it is used, they will simply return the given result structure as JSON.

The HTTP Response allows you to define the HTTP status code, content type, encoding, and HTTP headers. Note that the "Http content" field expects text (or JSON/XML, etc.) as the input type. Object references will not get serialized, so any custom expressions need to return a string.

Starting from version 4.5.4, you can also return binary HTTP responses. Selecting "HTTP Binary response" as the return type lets you give an expression that returns a byte array to the "Http bytes" field.

Note that when using the HTTP Response or HTTP Binary Response return types, the HTTP request handler will skip all content negotiation. The response will have the content type and encoding given, even if the request had an ACCEPT header with a specific request, such as for application/xml.

Did this answer your question?