HTTP Request
The HTTP Request node is one of the most versatile nodes. It enables you to make HTTP requests to query data from any application or service with a REST API.
When using this node, you create a REST API call. You need a basic understanding of API terminology and concepts.
There are two ways to create an HTTP request: configure the node parameters or import a curl command.
Refer to HTTP Request credentials for guidance on setting up authentication.
Node parameters
Method
Select the HTTP method for the request:
- DELETE
- GET
- HEAD
- OPTIONS
- PATCH
- POST
- PUT
URL
Enter the API endpoint URL.
Authentication
We recommend using the Predefined Credential Type option when available. It provides an easier way to set up and manage credentials compared to configuring generic credentials.
Generic credentials
Credentials for integrations that are not natively supported. You must manually configure the authentication process, including specifying the required API endpoints, necessary parameters, and authentication method.
You can select one of the following methods:
- Basic auth
- Custom auth
- Digest auth
- Header auth
- OAuth1 API
- OAuth2 API
- Query auth
Refer to HTTP request credentials for more information on setting up each credential type.
Send Query Parameters
Query parameters act as filters on HTTP requests. If the API you're interacting with supports them and your request requires filtering, enable this option.
Specify query parameters using one of the following options:
- Using Fields Below: Enter Name/Value pairs for Query Parameters. To add more query parameter name/value pairs, select Add Parameter. The name is the field you're filtering on, and the value is the filter value.
- Using JSON: Enter JSON to define your query parameters.
Refer to your service's API documentation for detailed guidance.
Send Headers
Use this parameter to send headers with your request. Headers contain metadata or context about your request.
Specify Headers using one of the following options:
- Using Fields Below: Enter Name/Value pairs for Header Parameters. To add more header parameter name/value pairs, select Add Parameter. The name is the header you want to set, and the value is the value you want to pass for that header.
- Using JSON: Enter JSON to define your header parameters.
Refer to your service's API documentation for detailed guidance.
Send Body
If you need to send a body with your API request, enable this option.
Then select the Body Content Type that matches the format of the body content you want to send.
Form URLencoded
Use this option to send your body as application/x-www-form-urlencoded.
Specify Body using one of the following options:
- Using Fields Below: Enter Name/Value pairs for Body Parameters. To add more body parameter name/value pairs, select Add Parameter. The name should be the form field name, and the value is what you want to set that field to.
- Using Single Field: Enter your name/value pairs in a single Body parameter with the format
fieldname1=value1&fieldname2=value2.
Refer to your service's API documentation for detailed guidance.
Form-Data
Use this option to send your body as multipart/form-data.
Configure your Body Parameters by selecting the Parameter Type:
- Choose Form Data to enter Name/Value pairs.
- Choose Binary File to pull the body from a file that the node can access.
- Name: Enter the ID of the field to set.
- Input Data Field Name: Enter the name of the incoming field containing the binary file data you want to process.
Select Add Parameter to add more parameters.
Refer to your service's API documentation for detailed guidance.
JSON
Use this option to send your body as JSON.
Specify Body using one of the following options:
- Using Fields Below: Enter Name/Value pairs for Body Parameters. To add more body parameter name/value pairs, select Add Parameter.
- Using JSON: Enter JSON to define your body.
Refer to your service's API documentation for detailed guidance.
Binary File
Use this option to send the contents of a file stored in the workflow as the body.
Enter the name of the incoming field that contains the file as the Input Data Field Name.
Refer to your service's API documentation for detailed guidance on how to format the file.
Raw
Use this option to send raw data in the body.
- Content Type: Enter the
Content-Typeheader for the raw body content. Refer to the IANA Media types documentation for a full list of MIME content types. - Body: Enter the raw body content to send.
Refer to your service's API documentation for detailed guidance.
Node options
Select Add Option to view and select these options. Options are available for all parameters unless otherwise noted.
Array Format in Query Parameters
This option is only available when you enable Send Query Parameters.
Use this option to control the format for arrays included in query parameters. Choose from these options:
- No Brackets: Arrays format as name=value for each item in the array, for example:
foo=bar&foo=qux. - Brackets Only: The node adds square brackets after each array name, for example:
foo[]=bar&foo[]=qux. - Brackets with Indices: The node adds square brackets with an index value after each array name, for example:
foo[0]=bar&foo[1]=qux.
Refer to your service's API documentation for guidance on which option to use.
Batching
Control how to batch large numbers of input items:
- Items per Batch: Enter the number of input items to include in each batch.
- Batch Interval: Enter the time to wait between each batch of requests in milliseconds. Enter 0 for no batch interval.
Lowercase Headers
Choose whether to lowercase header names (enabled by default) or not (disabled).
Redirects
Choose whether to follow redirects (enabled by default) or not (disabled). If enabled, enter the maximum number of redirects the request should follow in Max Redirects.
Response
Use this option to configure details about the expected API response, including:
- Include Response Headers and Status: By default, the node returns only the body. Enable this option to return the full response (headers and response status code) along with the body.
- Never Error: By default, the node returns success only when the response returns a 2xx status code. Enable this option to return success regardless of the status code returned.
- Response Format: Select the format in which the data is returned. Choose from:
- Autodetect (default): The node detects and formats the response based on the data returned.
- File: Select this option to save the response as a file. Enter the field name where you want the file returned in Put Output in Field.
- JSON: Select this option to format the response as JSON.
- Text: Select this option to format the response as plain text. Enter the field name where you want the text returned in Put Output in Field.
Timeout
Use this option to set how long the node should wait for the server to send response headers (and start the response body). The node aborts requests that exceed this value for the initial response.
Enter the Timeout duration in milliseconds.
Optimize Response
Whether to optimize the tool response to reduce the amount of data passed to the LLM. Optimizing the response can reduce costs and help the LLM ignore unimportant details, often leading to better results.
When optimizing responses, you select an expected response type, which determines the other options you can configure. The supported response types are:
JSON
When expecting a JSON response, you can configure which parts of the JSON data to use as a response with the following options:
- Field Containing Data: This field identifies a specific part of the JSON object that contains your relevant data. You can leave this blank to use the entire response.
- Include Fields: This determines which fields to include in your response object. There are three choices:
- All: Include all fields in the response object.
- Selected: Include only the fields specified below.
- Fields: A comma-separated list of fields to include in the response. You can use dot notation to specify nested fields. You can drag fields from the Input panel to add them to the field list.
- Exclude: Include all fields except the fields specified below.
- Fields: A comma-separated list of fields to exclude from the response. You can use dot notation to specify nested fields. You can drag fields from the Input panel to add them to the field list.
HTML
When expecting HTML, you can identify the relevant part of an HTML document for the LLM and optimize the response with the following options:
- Selector (CSS): A specific element or element type to include in the response HTML. Uses the
bodyelement by default. - Return Only Content: Whether to strip HTML tags and attributes from the response, leaving only the actual content. This uses fewer tokens and may be easier for the model to understand.
- Elements To Omit: A comma-separated list of CSS selectors to exclude when extracting content.
- Truncate Response: Whether to limit the response size to save tokens.
- Max Response Characters: The maximum number of characters to include in the HTML response. The default value is 1000.
Text
When expecting a generic Text response, you can optimize the results with the following options:
- Truncate Response: Whether to limit the response size to save tokens.
- Max Response Characters: The maximum number of characters to include in the text response. The default value is 1000.