Skip to main content
Introduction to HTTP Binary Response

Basic of HTTP Binary Responses

Aleksi Hytönen avatar
Written by Aleksi Hytönen
Updated over 7 months ago

HTTP Binary Response

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 content bytes" field.

HTTP Binary Response Example

HTTP Binary Response can be used to return binary data like for example ZIP file, PDF document or Excel spreadsheet to the API or HTTP client.

In this example GET /api/PDF/v1/create operation creates a PDF document containing the current date and time as text and returns the resulted binary PDF document to API client by using the Return element configured as HTTP Binary Response (marked with light yellow in the picture below):

Note

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 configured for the Return element, even if the request had an ACCEPT header with a specific request, e.g. for application/xml.

Did this answer your question?