HTTP is one of the most common ways to send data to and receive data from the Losant platform. Today's update adds a variety of improvements to the platform's existing HTTP connectors. We've also improved the security around using your own MongoDB database by adding a MongoDB Service Credential.
First up in our list of HTTP improvements is the ability to easily change the content type of Experience Pages. Since most experience pages render HTML content, the platform used to default the content type to "text/html" and this was difficult to change.
There are times you may want to render non-HTML content using experience pages. The Connected Product Foundation, for example, uses experience pages to also render CSS and JavaScript. Today's update adds the ability to directly change the content type for your experience pages.
Changing the content type of a page also changes the syntax highlighting of the code editor. The "Page Type" dropdown lists the most common options (HTML, CSS, JavaScript, JSON) with the added ability to set any custom content type value you require.
Today's update also adds several features to the HTTP Node. The first is support for the HTTP HEAD Method. The HEAD method is used to request just the headers (no body) from an HTTP endpoint. This is useful when requesting metadata about a resource like whether it exists, its content type, its modified status, and more.
In addition to supporting HEAD, we've also made the method field templatable, so you can now dynamically set this value.
The next addition to the HTTP Node is that the request duration, in milliseconds, has been added to the response object. With this value on the payload, it's now possible for your workflows to inspect and take appropriate actions when necessary.
Lastly, we've added two new formats you can use when defining the body of your request. The first is "JSON Template", which works similarly to the current "Raw Input" option, but adds syntax highlighting, JSON validation, and sets the content type header to "application/json" automatically.
The second new format is "From URL". This option instructs the platform to download the body from some other URL and then place that result on the body of this request. For example, if you wanted to send an Application File to another service, you can provide the file's URL in this field.
This option removes the need to download the contents using a separate HTTP Node and also allows for moving around data larger than 5MB (the maximum amount of data an HTTP Node can download).
Losant Service Credentials provide a secure way to store authentication tokens for external services. Today's update adds a new service credential for MongoDB.
If you're accessing your own MongoDB database, it's highly recommended that you migrate your implementation to use the service credential.
As always, this release comes with several minor features and improvements, including:
With every new release, we listen to your feedback. By combining your suggestions with our roadmap, we can continue to improve the platform while maintaining its ease of use. Let us know what you think in the Losant Forums.