Table of Contents

CONSTRUCT HTTP RESPONSE

Category: Transform / Web


Description

This action constructs the fields required for an HTTP response of the EasyMorph API Server.

A configured connection to an EasyMorph Server space is required.


Action settings

Setting Description
Response typeSelect the type of response sent to the sender. Options: Success, File download, Redirect, or Error.
Refer to the tables below for details.


Response Type: Success settings

Setting Description
Response codeSelect the response code to include in the response. Options: 200 OK, 201 Created, or 204 No Content.
BodyChoose the options for the response's Body. Refer to the table below for details.
Custom headersChoose the options for custom headers in the response. Refer to the table below for details.


Body settings

Setting Description
Response has no bodyCheck this if no body will be included in the response.
ColumnSelect the dataset column that contains the response body to return.
Body isCheck this if the response body (Column, selected above) contains more than a simple return value, and select its format. Options: JSON, XML or HTML.
Specify charsetIf "Body is" is checked on, select the character set the body uses. Options: ASCII, ANSI (with code page), Unicode, Big Endian Unicode, UTF-32, UTF-7, or UTF-8.

Remarks

If the response body is complex, such as JSON or HTML, and is specified using a column, the column with the response body should be constructed prior to "Construct HTTP response" using actions and functions available in EasyMorph, e.g. the "Construct JSON" action.


Custom headers settings

Enter Header/Value* pairs to include in the response body.

* Setting can be specified using a parameter.


Response Type: File download settings

Setting Description
Server file*Enter the path (from the root Public folder) and filename of the Server file to be returned. (e.g., "\subfolder\filename" if the file resides in a subfolder)
Download nameCheck and enter a name (including extension) to give the returned file a different filename than the original.
Delete the file after it was downloadedCheck to remove the file from the Server once it is downloaded.
When downloading in Web browserChoose "Save" to have the file downloaded onto the recipient's system. Select "Open in browser tab" to have the contents of the file open in the browser window. (This works for text-based files and images only. All other types will be downloaded, instead).

* Setting can be specified using a parameter.


Response Type: Redirect settings

Setting Description
Redirect typeSelect the redirect code/type to include in the response. Options: 302 Found, 303 See Other, 307 Temporary Redirect,
or 308 Permanent Redirect.
Redirect URL*Enter the URL the request sender is redirected to.

* Setting can be specified using a parameter.


Response Type: Error settings

Setting Description
Response codeSelect the error code/type to include in the response. Options: 400 Bad Request, 401 Unauthorized, 403 Forbidden, or 500 Internal Server Error.
Include error messageCheck this to include a custom error code and message and enter the Error code(s)* and Error message(s)*.

* Setting can be specified using a parameter.


Community references

How to create API Endpoints


See also