关于HTTP请求节点的返回值files,是怎么构建的?(不使用插件开发可以做到吗) #145

Open
opened 2026-02-16 11:19:52 -05:00 by yindo · 3 comments
Owner

Originally created by @Teenye on GitHub (Apr 19, 2025).

您好作者,我在dify的工作流中看到了http请求有一个返回值files。请问自定义http请求时,怎么返回这个返回值files呢?比如返回多张图片文件和一个文本文件

Originally created by @Teenye on GitHub (Apr 19, 2025). 您好作者,我在dify的工作流中看到了http请求有一个返回值files。请问自定义http请求时,怎么返回这个返回值files呢?比如返回多张图片文件和一个文本文件
yindo added the question label 2026-02-16 11:19:52 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Apr 19, 2025):

Hello @Teenye! I'm Dosu, here to help you with any bugs, questions, or contributions you might have while we wait for a human maintainer. Let's tackle your issue together!

在 Dify 的工作流中,HTTP 请求节点会自动处理返回值中的 files,并保存这些文件以供后续步骤使用。目前,它仅支持图像类型的文件 [1]。关于如何在自定义 HTTP 请求中返回多个文件(如多张图片和一个文本文件),我没有找到具体的格式或示例代码。如果需要进一步的信息,可能需要查看其他资源或文档。

To continue talking to Dosu, mention @dosu.


Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Bug Report | Other

@dosubot[bot] commented on GitHub (Apr 19, 2025): <!-- Greeting --> Hello @Teenye! I'm [Dosu](https://dosu.dev), here to help you with any bugs, questions, or contributions you might have while we wait for a human maintainer. Let's tackle your issue together! <!-- Answer --> 在 Dify 的工作流中,HTTP 请求节点会自动处理返回值中的 `files`,并保存这些文件以供后续步骤使用。目前,它仅支持图像类型的文件 <sup>[[1]](https://github.com/langgenius/dify-docs/blob/main/zh_CN/guides/workflow/node/http_request.md)</sup>。关于如何在自定义 HTTP 请求中返回多个文件(如多张图片和一个文本文件),我没有找到具体的格式或示例代码。如果需要进一步的信息,可能需要查看其他资源或文档。 <!-- Dosu Comment Footer --> *To continue talking to [Dosu](https://dosu.dev), mention @dosu.* --- <sup>Help Dosu learn! Give it feedback: [Great Response](https://app.dosu.dev/response-feedback/e64cca32-7f1c-48ac-8572-a85248dc8740?feedback_type=great_response) | [Irrelevant Answer](https://app.dosu.dev/response-feedback/e64cca32-7f1c-48ac-8572-a85248dc8740?feedback_type=irrelevant_answer) | [Incorrect Sources](https://app.dosu.dev/response-feedback/e64cca32-7f1c-48ac-8572-a85248dc8740?feedback_type=incorrect_sources) | [Too Verbose](https://app.dosu.dev/response-feedback/e64cca32-7f1c-48ac-8572-a85248dc8740?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/e64cca32-7f1c-48ac-8572-a85248dc8740?feedback_type=hallucination) | [Bug Report](https://app.dosu.dev/response-feedback/e64cca32-7f1c-48ac-8572-a85248dc8740?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/e64cca32-7f1c-48ac-8572-a85248dc8740?feedback_type=other)</sup>
Author
Owner

@Teenye commented on GitHub (Apr 19, 2025):

似乎我看到,使用插件的话是可以通过create_blob_message来构建files的返回值。但是我这边有些原因没法通过插件的形式来开发。请问只用http请求是否也可以得到这个files返回值给dify用于后续的分析呢?如果你知道怎么样设计这样的http response请告诉我,谢谢你~

@Teenye commented on GitHub (Apr 19, 2025): 似乎我看到,使用插件的话是可以通过create_blob_message来构建files的返回值。但是我这边有些原因没法通过插件的形式来开发。请问只用http请求是否也可以得到这个files返回值给dify用于后续的分析呢?如果你知道怎么样设计这样的http response请告诉我,谢谢你~
Author
Owner

@dosubot[bot] commented on GitHub (Apr 19, 2025):

在不使用插件的情况下,通过 HTTP 请求节点返回 files 值的具体方法和格式在 Dify 文档中没有明确说明。不过,您可以尝试使用 multipart/form-data 格式来上传文件,因为这种格式通常用于文件上传的 HTTP 请求。请注意,Dify 对文件的上传有一些限制:单个文件的大小限制为 15MB,最多可以同时上传 5 个文件 [1]

如果您需要进一步的指导,可能需要查看其他相关的文档或资源。

To continue talking to Dosu, mention @dosu.


Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Bug Report | Other

@dosubot[bot] commented on GitHub (Apr 19, 2025): <!-- Answer --> 在不使用插件的情况下,通过 HTTP 请求节点返回 `files` 值的具体方法和格式在 Dify 文档中没有明确说明。不过,您可以尝试使用 `multipart/form-data` 格式来上传文件,因为这种格式通常用于文件上传的 HTTP 请求。请注意,Dify 对文件的上传有一些限制:单个文件的大小限制为 15MB,最多可以同时上传 5 个文件 <sup>[[1]](https://github.com/langgenius/dify-docs/blob/main/en/getting-started/install-self-hosted/environments.md)</sup>。 如果您需要进一步的指导,可能需要查看其他相关的文档或资源。 <!-- Dosu Comment Footer --> *To continue talking to [Dosu](https://dosu.dev), mention @dosu.* --- <sup>Help Dosu learn! Give it feedback: [Great Response](https://app.dosu.dev/response-feedback/b317d0c6-4195-4754-a438-b058f155b228?feedback_type=great_response) | [Irrelevant Answer](https://app.dosu.dev/response-feedback/b317d0c6-4195-4754-a438-b058f155b228?feedback_type=irrelevant_answer) | [Incorrect Sources](https://app.dosu.dev/response-feedback/b317d0c6-4195-4754-a438-b058f155b228?feedback_type=incorrect_sources) | [Too Verbose](https://app.dosu.dev/response-feedback/b317d0c6-4195-4754-a438-b058f155b228?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/b317d0c6-4195-4754-a438-b058f155b228?feedback_type=hallucination) | [Bug Report](https://app.dosu.dev/response-feedback/b317d0c6-4195-4754-a438-b058f155b228?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/b317d0c6-4195-4754-a438-b058f155b228?feedback_type=other)</sup>
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify-docs-archived#145