Skip to main content
Example on HTTP Binary Response

Basics of HTTP Binary Response

Ossi Galkin avatar
Written by Ossi Galkin
Updated over 10 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.

The next article is Introduction to API Keys

Did this answer your question?