HTTP Request (Streaming)

Make HTTP requests and optionally stream the response

HTTP Request (Streaming)

AI-generated

Overview

This node performs HTTP requests with support for various authentication methods and can optionally stream the HTTP response in real-time. It is useful for integrating with APIs or web services where you need to send requests with custom headers, query parameters, and body content, and handle responses as JSON, text, or binary files. Streaming is beneficial for processing large or continuous data streams, such as real-time event feeds or large file downloads.

Use Case Examples

  1. Sending a GET request to a REST API with query parameters and basic authentication.
  2. Posting JSON data to a webhook endpoint with OAuth2 authentication.
  3. Streaming a large file download and processing it chunk-by-chunk in real-time.

Properties

Name Meaning
Authentication The authentication method to use for the HTTP request, including none, predefined credentials, or generic credential types like basic, header, query, or OAuth2 authentication.
Credential Type The specific predefined credential to use when 'Predefined Credential Type' authentication is selected.
Generic Auth Type The type of generic authentication to use when 'Generic Credential Type' is selected, such as Basic Auth, Header Auth, Query Auth, or OAuth2.
Method The HTTP method to use for the request, e.g., GET, POST, PUT, DELETE, PATCH, HEAD.
URL The URL to which the HTTP request is sent. Must start with 'http://' or 'https://'.
Send Query Whether to send query parameters with the request.
Query Parameters The list of query parameters to include in the request URL if 'Send Query' is enabled.
Send Headers Whether to send custom headers with the request.
Header Parameters The list of header parameters to include in the request if 'Send Headers' is enabled.
Send Body Whether to send a body with the request (applicable for POST, PUT, PATCH methods).
Body Content Type The content type of the body to send, either JSON or raw text.
JSON Body The JSON content to send in the body if 'Body Content Type' is JSON.
Raw Body The raw text content to send in the body if 'Body Content Type' is raw.
Options Additional options for the request such as enabling streaming, proxying streaming chunks, response format, returning full response, output property name, and request timeout.

Output

Binary

Outputs binary data when the response format is set to file (binary), useful for handling file downloads or binary streams.

JSON

  • statusCode - HTTP status code of the response.
  • statusMessage - HTTP status message of the response.
  • headers - HTTP headers returned in the response.
  • body - Parsed JSON body of the response if response format is JSON.
    - The main response content, which can be JSON data, text, or status information depending on the response format and options.

Dependencies

  • Requires credentials for authentication if selected, such as basic auth credentials, header auth credentials, query auth credentials, or OAuth2 credentials.

Troubleshooting

  • Invalid URL error if the URL does not start with 'http://' or 'https://'. Ensure the URL is correctly formatted.
  • Invalid JSON body error if the JSON body input is not valid JSON. Validate and correct the JSON syntax.
  • Streaming errors if the response is not a readable stream but streaming is enabled. Disable streaming or adjust the response format.
  • Timeout errors if the request takes longer than the specified timeout. Increase the timeout or check network connectivity.

Links

Discussion