entitys

Overview

This node performs HTTP POST requests to a user-specified URL with customizable headers, query parameters, and body content. It supports sending the request body either as raw JSON or as individual key-value parameters. The node can handle different response formats including JSON, plain string, or file (binary data). This flexibility makes it useful for integrating with various REST APIs that require POST operations, such as submitting forms, uploading data, or triggering remote actions.

Common scenarios:

  • Sending data to an API endpoint that accepts JSON payloads.
  • Posting form-like data using key-value pairs.
  • Downloading files or binary responses from an API.
  • Customizing headers and query parameters dynamically per execution.

Practical example:

  • Posting a JSON object to a webhook URL to trigger an event.
  • Uploading metadata via query parameters while sending a JSON body.
  • Receiving a file from an API and saving it in n8n’s binary data format.

Properties

Name Meaning
URL The full URL of the API endpoint where the POST request will be sent.
JSON Parameters Boolean flag to choose between sending the body as raw JSON (true) or as key-value pairs (false).
Body Raw JSON object to send as the request body when "JSON Parameters" is enabled (true).
Body Parameters Collection of key-value pairs to send as the request body when "JSON Parameters" is disabled (false).
Headers Collection of HTTP headers to include in the request, each defined by a name and value.
Query Parameters Collection of key-value pairs to append as query parameters to the URL.
Response Format Defines how the response should be handled: json (parsed JSON), string (plain text), or file (binary data).

Output

The node outputs an array of items corresponding to the input items processed:

  • For Response Format set to JSON or String, the output item contains a json property holding the parsed JSON object or string response respectively.
  • For Response Format set to File, the output item contains a binary property with the downloaded file stored under the key "data". The binary data is prepared and named "response.bin" internally.

Example output structure for JSON response:

[
  {
    "json": {
      "key1": "value1",
      "key2": "value2"
    }
  }
]

Example output structure for file response:

[
  {
    "binary": {
      "data": {
        "data": "<Buffer ...>",
        "mimeType": "application/octet-stream",
        "fileName": "response.bin"
      }
    },
    "json": {}
  }
]

Dependencies

  • Requires an HTTP endpoint URL to send POST requests.
  • Supports optional authentication via either basic HTTP authentication or header-based authentication if configured in the node credentials.
  • No external libraries beyond n8n's built-in HTTP request helpers are required.

Troubleshooting

  • Empty or invalid URL: Ensure the URL property is correctly set and includes the protocol (e.g., https://).
  • Authentication errors: If using authentication, verify that the correct credentials are configured and valid.
  • Invalid JSON body: When using raw JSON body, ensure the JSON syntax is correct; otherwise, the request may fail.
  • Unexpected response format: Choose the appropriate response format matching the API response to avoid parsing errors.
  • Network issues: Check network connectivity and endpoint availability if requests time out or fail.

Common error messages might include:

  • Request failed with status code 4xx/5xx: Indicates client or server errors; check URL, headers, and body content.
  • Invalid JSON: Occurs if the body JSON is malformed.
  • Authentication failed: Verify credentials and authentication method.

Links and References

Discussion