Advanced HTTP Request icon

Advanced HTTP Request

Makes HTTP requests with advanced type conversion and validation

Advanced HTTP Request

AI-generated

Overview

The node performs advanced HTTP requests with flexible configuration options and enhanced type conversion for request data. It supports all common HTTP methods (GET, POST, PUT, PATCH, DELETE, HEAD, OPTIONS) and allows users to specify URLs, headers, body content, and various request options such as redirects, timeouts, and SSL validation.

This node is beneficial when you need to interact with any RESTful API or web service where you want fine control over the request details, including dynamic construction of requests from incoming JSON data. For example, it can be used to:

  • Call a third-party API with custom headers and authentication.
  • Send JSON payloads with automatic type conversion.
  • Follow redirects or handle timeouts explicitly.
  • Retrieve full HTTP responses including headers and status codes for debugging or advanced processing.

Properties

Name Meaning
Method The HTTP method to use for the request. Options: DELETE, GET, HEAD, OPTIONS, PATCH, POST, PUT
URL The target URL to which the HTTP request will be sent.
Use Dynamic Data Whether to construct the request dynamically from incoming JSON data with automatic type conversion.
Headers Custom HTTP headers to include in the request (only when not using dynamic data).
Body JSON body content to send with POST, PUT, or PATCH requests (only when not using dynamic data).
Options Additional request options:
- Follow Redirects Whether to follow HTTP redirects (default: true).
- Max Redirects Maximum number of redirects to follow (default: 5).
- Return Full Response Whether to return the full HTTP response including headers and status code instead of just the body.
- Timeout Request timeout in milliseconds (default: 30000 ms).
- Validate SSL Certificate Whether to validate SSL certificates (default: true).

Output

The node outputs an array of items corresponding to each input item processed. Each output item contains a json field structured as follows:

  • If Return Full Response option is disabled (default):

    {
      "data": <response_body>
    }
    

    Where <response_body> is the parsed response body from the HTTP request.

  • If Return Full Response option is enabled:

    {
      "statusCode": <HTTP_status_code>,
      "headers": { <response_headers> },
      "body": <response_body>,
      "url": <request_url>,
      "method": <request_method>
    }
    

    The headers are sanitized to redact sensitive authorization tokens or cookies by truncating or replacing their values.

If the node encounters errors and is configured to continue on failure, it outputs an error object with fields like error (message) and statusCode.

The node does not output binary data.

Dependencies

  • Requires no external libraries beyond those bundled with n8n.
  • Supports optional credentials for HTTP Basic Auth or Header Auth if configured in n8n (not detailed here).
  • No environment variables required.
  • Uses built-in HTTP request helper from n8n workflow utilities.

Troubleshooting

  • Invalid URL Error: If the URL parameter is malformed or missing, the node throws an error "Invalid URL". Ensure the URL starts with http:// or https:// and is correctly formatted.
  • Type Conversion Errors: When using dynamic data, invalid type conversions (e.g., parsing integers, arrays, or objects) may cause errors. Check that your incoming JSON data matches expected types.
  • Timeouts: Requests may fail if the target server is slow or unresponsive. Adjust the timeout option accordingly.
  • SSL Validation Failures: If connecting to servers with self-signed or invalid certificates, disable SSL validation via the option, but be aware of security risks.
  • Authorization Headers Redacted: Sensitive headers in the output are redacted for security; this is normal behavior.
  • Continue On Fail Behavior: If enabled, errors do not stop execution but are returned as error objects per item.

Links and References

Discussion