HTTP Request Node
A tool that sends requests to external websites or services within automation workflows, allowing different applications to communicate and share data automatically.
What is an HTTP Request Node?
An HTTP Request Node is a central component in automation and integration platforms (n8n, Node-RED, Node.js) that sends HTTP requests (GET, POST, PUT, PATCH, DELETE) to external servers or APIs, processing responses within automation workflows. This node is vital for integrating systems, consuming third-party services, triggering webhooks, and exchanging data between applications.
Core Capabilities
Supported HTTP Methods:
- GET β Retrieve data from specified resource
- POST β Send data to create or update resource
- PUT β Replace or update resource
- PATCH β Partially update resource
- DELETE β Remove resource
- HEAD β Retrieve headers without response body
- OPTIONS β Query supported communication options
Authentication Options:
- No Authentication (open endpoints)
- Basic Authentication (username/password, Base64-encoded)
- Digest Authentication (hashed credentials)
- Bearer Token (JWT in Authorization header)
- OAuth1 & OAuth2 (delegated, token-based access)
- Header Auth (custom headers for API keys)
- Custom Auth (user-defined logic)
- Query Auth (credentials via query parameters)
Supported Data Formats:
- application/json (JSON payloads)
- application/x-www-form-urlencoded (key/value pairs)
- multipart/form-data (file uploads, complex data)
- Raw (arbitrary content with specified content type)
- Plain Text (unstructured text)
- Binary (file and binary data transfer)
Additional Features:
- Custom headers (Content-Type, Authorization)
- Query parameters (dynamic filtering)
- Proxy support (HTTP proxies)
- Timeouts (request and connection control)
- SSL validation control (ignore certificate errors)
- Automatic and manual pagination
- Redirect handling
- Response handling (JSON, text, binary, file)
- Batching (parallel or sequential requests)
Configuration by Platform
n8n HTTP Request Node
Basic Parameters:
- Method β Select HTTP method (DELETE, GET, HEAD, OPTIONS, PATCH, POST, PUT)
- URL β API endpoint (static or dynamic using expressions)
- Authentication β Choose predefined credentials or configure manually
- Send Query Parameters β Define as key/value pairs or JSON
- Send Headers β Specify custom headers
- Send Body β Enable for POST, PUT, PATCH requests
- Output Variables β Map status code, body, headers to workflow variables
Advanced Options:
- Array format in query parameters
- Batching (items per batch, delay between batches)
- Ignore SSL issues (trusted endpoints only)
- Lowercase headers toggle
- Redirects (enable/disable, max redirects)
- Response handling (include headers/status, format)
- Pagination (off, parameter update, next URL)
- Proxy specification
- Timeout (request timeout in ms)
Example POST Request:
{
"method": "POST",
"url": "https://api.example.com/resource",
"headers": {
"Content-Type": "application/json"
},
"body": {
"name": "John Doe",
"email": "john@example.com"
}
}
Node-RED HTTP Request Node
Configuration:
- Method β GET, POST, PUT, DELETE, PATCH
- URL β Static or dynamic using Mustache syntax (
{{variable}}) - Payload β Ignore, append to query string, or send as body
- Authentication β None, Basic, Digest, Bearer Token
- Proxy β Route via proxy server if needed
- Headers β Add via node config or
msg.headers - Output β Specify response as string, parsed JSON, or binary buffer
- Catch Node β Handle non-2xx HTTP responses
Example Dynamic GET Request:
{
"method": "GET",
"url": "https://api.example.com/users/{{userId}}",
"headers": {
"Authorization": "Bearer {{token}}"
}
}
Important: Reset msg.headers to {} between HTTP nodes to avoid header leakage.
Node.js HTTP Requests
Native HTTP/HTTPS Modules:
Low-level modules for full control over requests with built-in streaming support.
Fetch API (Node.js 18+):
Built-in since Node.js 18, returns Promises, supports async/await syntax.
const response = await fetch('https://api.example.com/data');
const data = await response.json();
console.log(data);
axios:
Promise-based HTTP client with interceptors, timeout, automatic JSON handling, request/response transformation.
const axios = require('axios');
axios.post('https://api.example.com/resource', {
name: 'John Doe',
email: 'john@example.com'
}, {
headers: {
'Authorization': 'Bearer YOUR_TOKEN'
}
}).then(response => {
console.log(response.data);
});
Best Practices
Security:
- Use built-in credential managers, never hard-code secrets
- Always use HTTPS with SSL certificate validation
- Sanitize all dynamic input (headers, params, body)
- Rotate, expire, and securely store tokens
Error Handling:
- Always check and handle HTTP status codes
- Set appropriate timeouts to avoid hanging requests
- Implement retries for transient failures (network, 5xx errors)
Content Types and Encoding:
- Match Content-Type header to body format
- URL-encode query parameters for special characters
- Check API docs for required array encoding
Pagination:
- Recognize API patterns (page/limit, offset, next URL)
- Use platform pagination features where possible
Headers and Response Handling:
- In Node-RED, reset
msg.headersbetween HTTP nodes - Check response headers for rate limits, authentication challenges, pagination
Debugging:
- Validate configs with built-in test features or tools like Postman
- Log full responses for troubleshooting
Common Pitfalls
- Incorrect Content-Type causing API rejections
- Unencoded query params with special characters
- Header inheritance in Node-RED (must reset between nodes)
- Ignoring non-2xx responses without proper error handling
- Missing authentication for APIs requiring credentials
Use Cases
API Integration:
Fetch user info from REST API. Configure GET method, set URL, add Authorization header, map response.
Sending Data:
Submit form. POST method, Content-Type application/x-www-form-urlencoded, enter fields.
File Upload:
Upload file using multipart/form-data. POST/PUT, attach file.
Webhook Trigger:
Notify external system upon event. POST method, set URL, send JSON body.
Automation with AI Agents (n8n):
Use HTTP Request Node in LLM workflow. Attach node, configure optimized response extraction.
Platform-Specific Notes
n8n:
- Predefined OAuth2, API Key, generic auth options
- Drag-and-drop UI, cURL import
- Body/Headers/Query as fields or direct JSON input
- Pagination supports parameter increment and next-URL
- AI Agent Integration optimizes responses for LLMs
Node-RED:
- Dynamic config via
msg.method,msg.url,msg.headers - Mustache syntax for dynamic URLs/headers
- Auto Content-Type for object payloads
- Response handling: string, JSON, binary buffer
Node.js:
- HTTP/HTTPS: Low-level, full control
- axios/node-fetch/Fetch API: High-level, Promise-based
- Native streaming support
- Proxy via environment or library options
References
- n8n HTTP Request Node Documentation
- Mastering the n8n HTTP Request Node
- Node-RED HTTP Request Node
- Node-RED Securing Guide
- Node-RED HTTPS Configuration
- Node-RED Proxy Configuration
- Node.js HTTP Module Documentation
- W3Schools: Node.js HTTP Module
- Axios Documentation
- Node.js Fetch API Guide
- Stack Overflow: HTTP POST in Node.js
- Postman
Related Terms
API Integration
A system that automatically connects different software applications so they can share data and work...
Make (Integromat)
A no-code platform that automates repetitive tasks by visually connecting apps and services without ...
Minimap
A small overview map positioned at the screen's edge that shows a bird's-eye view of large, complex ...
User Roles
User Roles are permission levels assigned to people in a system that control what they can see and d...
Version History / Rollback
Version history is a record of all previous states of a chatbot's settings and behavior, while rollb...
n8n
n8n is a source-available, node-based workflow automation tool that connects your apps, APIs, and se...