Table of Contents
Automation Pilot provides the HttpRequest command which allows customers to perform arbitrary HTTP request to any public endpoint. Its flexibility and simplicity provides a way to use and automate most modern HTTP APIs.
To ensure scalability and optimal performance for all Automation Pilot customers, the HttpRequest command has a strict limit on the maximum time that each request can take, as well as limit on the response size.
However, some customer scenarios require working with synchronous HTTP APIs. Request to such APIs might take minutes to complete. Similar requirements could also apply to the response size.
Automation Pilot enables such scenarios with the ExecuteScript command. It can be used to run scripts in a fully isolated environment. These scripts can run for up to 5 minutes with limited set of computing, memory and storage resources.
The supported runtimes include bash, python, node.js and provides access to popular CLI tools including curl, jq, and git.
This example command has very similar contract to the original HttpRequest. However, its implementation is base entirely on ExecuteScript by utilizing curl and jq. It could be used to send requests to slow synchronous APIs and to work with larger response bodies.
There are no mandatory requirements. This command can perform HTTP requests to any public endpoint.
Import the content of examples catalog in your Automation Pilot tenant. Navigate to the HttpRequestViaScript command and trigger it.
You'll need to provide values for the following input keys:
- method - Request method to use
- url - URL to which to send the request
- body - Optional: Request body to send with the request
- headers - Optional: Request headers to send with the request
- timeout - Optional: Maximum time that the request can take. Defauls to 60 seconds. Maximum allowed value is 240 seconds.
- user - Optional: User name to use for server authentication
- password - Optional: Password to use for server authentication
- authorizationHeader - Optional: Explicit value for the HTTP authorization header. Overwrites all other forms of authentication
- responseBodyTransformer - Optional: JQ expression to transform the response body with. The format must follow the one described in https://github.com/stedolan/jq
Let's execute the HttpRequestViaScript command with the following input:
- method - GET
- url - https://eu10.autopilot.ondemand.com/health
- timeout - 30
After a few seconds, the execution should finish successfully:
The execution's output should be similar to this one: