HTTP Request Block

Make HTTP requests within Scout workflows

The HTTP Request block enables users to perform HTTP requests within Scout workflows, facilitating integration with external APIs and services. This block supports various HTTP methods and allows for dynamic request construction using Jinja templating.

Configuration (Required)

Method
selectRequired

Select the HTTP method to use for the request. Common methods include GET, POST, PUT, PATCH, and DELETE. Choose the method that corresponds to the action you wish to perform with the HTTP request.

URL
stringRequired

The URL specifies the endpoint to which the HTTP request will be sent. Ensure the URL is correctly formatted and points to the desired resource on the external service. This field supports Jinja templating for dynamic URL construction.

Request body
code

The request body is used for POST, PUT, and PATCH requests. It allows you to specify the data to be sent with the request. This field supports Jinja templating for dynamic content generation.

Headers
list

Headers are used to pass additional information with the HTTP request, such as authentication tokens or content types. This field supports Jinja templating for dynamic header construction.

See Workflow Logic & State > State Management for details on using dynamic variables in this block.

Outputs

The output of the HTTP Request block is the response from the HTTP request, which can be either a JSON object or a string depending on the content type of the response.

Usage Context

Use this block to interact with external APIs or services within your workflow. This is particularly useful for tasks that require fetching data from web services or submitting data to remote servers.

Best Practices

  • Ensure the URL and method are correct and appropriate for the intended API endpoint.
  • Use Jinja templating to dynamically construct URLs, headers, and request bodies based on the workflow state.
  • Handle possible exceptions from HTTP requests to manage errors gracefully.
  • Consider setting appropriate timeouts and error handling strategies for network requests.