Skip to content

About

Make the HTTP Request Node in Dify a tool that LLM can call automatically (Capable of almost the same ability as the HTTP Request Node).

Resources

Stars

1 star

Watchers

0 watching

Forks

Repository files navigation

http-request

Author: aidenhong1 Version: 0.0.1 Type: tool

Description

Turns Dify's HTTP Request node into a tool the LLM can call on its own. It exposes the same feature set as the workflow node — any HTTP method, custom headers, query parameters, and every body encoding — as a single on-demand tool call, so an agent can decide mid-conversation that it needs to hit an external API.

Setup

Before everything starts, make sure you have enabled verification on the daemon and added the public key pair.

No credentials are required by default (Authentication type: None). If the target API needs authentication, configure it once at the provider level and every tool call will use it automatically:

Authentication type Fields to fill in Behavior
None — No Authorization header is added
Bearer Token API Key / Token Adds Authorization: Bearer <token>
Basic Auth Basic auth username, Basic auth password Adds Authorization: Basic <base64(user:pass)>
Custom Header Custom header name, API Key / Token Adds <header name>: <token>

Set these on the plugin's credential configuration screen in Dify before enabling the tool. A header the model passes explicitly in a tool call always overrides the provider default of the same name.

Usage

Add the HTTP Request tool to an Agent app (or any node that accepts tools) and let the model decide when to call it. The model fills in these parameters itself:

Parameter Type Notes
method select GET / POST / PUT / PATCH / DELETE / HEAD / OPTIONS
url string Full URL including scheme, e.g. https://api.example.com/v1/users
headers string (JSON) e.g. {"Accept": "application/json"}
params string (JSON) URL query parameters, e.g. {"page": 1}
body_type select none / json / raw / form-data / x-www-form-urlencoded / binary
body string JSON object string for json/form-data/x-www-form-urlencoded, plain text for raw, base64 for binary

Four parameters are fixed by whoever adds the tool to an app, not by the model: timeout (seconds, default 30), verify_ssl (default true), follow_redirects (default true), and max_response_size (bytes, default 10485760).

Example — a model deciding to look up a GitHub user:

method: GET
url: https://api.github.com/users/octocat
headers: {"Accept": "application/vnd.github+json"}
body_type: none

Output — a JSON message with status_code, headers, url, and body (parsed as JSON when the response is JSON, otherwise returned as plain text). If the response has a binary content type (e.g. an image or a PDF), the tool additionally returns the raw bytes as a file.

About

Make the HTTP Request Node in Dify a tool that LLM can call automatically (Capable of almost the same ability as the HTTP Request Node).

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages