[DOCS]: http 组件支持返回 cookie 的接口吗 #271

Closed
opened 2026-02-16 05:19:41 -05:00 by yindo · 1 comment
Owner

Originally created by @cutelitchi on GitHub (Nov 23, 2025).

Type of Documentation Change

Other

Documentation Page URL or Path

No response

Current Content

请问一下,http 组件支持返回 cookie 的接口吗

Suggested Changes

希望可以确认一下。

Reason for Change

No response

Code of Conduct

  • I agree to follow Dify's documentation contribution guidelines
  • I have searched for existing issues search for existing issues, including closed ones.
  • I confirm that I am using English to submit this report, otherwise it will be closed.
  • 【中文用户 & Non English User】请使用英语提交,否则会被关闭 :)
  • Please do not modify this template :) and fill in all the required fields.
Originally created by @cutelitchi on GitHub (Nov 23, 2025). ### Type of Documentation Change Other ### Documentation Page URL or Path _No response_ ### Current Content 请问一下,http 组件支持返回 cookie 的接口吗 ### Suggested Changes 希望可以确认一下。 ### Reason for Change _No response_ ### Code of Conduct - [x] I agree to follow Dify's documentation [contribution guidelines](https://github.com/langgenius/dify/blob/0277a37fcad5ad86aeb239485c27fffd5cd90043/CONTRIBUTING.md) - [x] I have searched for existing issues [search for existing issues](https://github.com/langgenius/dify/issues), including closed ones. - [x] I confirm that I am using English to submit this report, otherwise it will be closed. - [x] 【中文用户 & Non English User】请使用英语提交,否则会被关闭 :) - [x] Please do not modify this template :) and fill in all the required fields.
yindo added the documentationquestion labels 2026-02-16 05:19:41 -05:00
yindo closed this issue 2026-02-16 05:19:41 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Nov 23, 2025):

Hi @cutelitchi! I'm Dosu and I’m helping the dify-docs team.

Dify 的 HTTP 组件会把 HTTP 响应的所有 headers(包括 Set-Cookie)作为 outputs 返回,所以你可以通过 headers 字段获取服务器返回的 cookie 信息。不过,目前没有专门针对 cookie 的独立接口或结构,所有 cookie 都作为 headers 的一部分暴露。例如:

outputs = {
    "status_code": response.status_code,
    "body": response.text,
    "headers": response.headers,  # 这里包含 Set-Cookie
    "files": files,
}

你可以在 headers 里查找 Set-Cookie 字段来获取 cookie 信息。具体实现可参考 源码Response 类

如果文档没有明确说明,建议补充说明 headers 字段包含所有响应头(包括 cookie)。

To reply, just mention @dosu.


How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other

Open in Cursor Join Discord Share on X

@dosubot[bot] commented on GitHub (Nov 23, 2025): <!-- Greeting --> Hi @cutelitchi! I'm [Dosu](https://go.dosu.dev/dosubot) and I’m helping the dify-docs team. <!-- Answer --> Dify 的 HTTP 组件会把 HTTP 响应的所有 headers(包括 Set-Cookie)作为 outputs 返回,所以你可以通过 headers 字段获取服务器返回的 cookie 信息。不过,目前没有专门针对 cookie 的独立接口或结构,所有 cookie 都作为 headers 的一部分暴露。例如: ```python outputs = { "status_code": response.status_code, "body": response.text, "headers": response.headers, # 这里包含 Set-Cookie "files": files, } ``` 你可以在 headers 里查找 Set-Cookie 字段来获取 cookie 信息。具体实现可参考 [源码](https://github.com/langgenius/dify/blob/c75a4e6309de08474dc2c6951cbd4a52e92514e5/api/core/workflow/nodes/http_request/node.py#L89-L128) 和 [Response 类](https://github.com/langgenius/dify/blob/c75a4e6309de08474dc2c6951cbd4a52e92514e5/api/core/workflow/nodes/http_request/entities.py#L96-L102)。 如果文档没有明确说明,建议补充说明 headers 字段包含所有响应头(包括 cookie)。 <!-- Dosu Comment Footer --> *To reply, just mention [@dosu](https://go.dosu.dev/dosubot).* --- <sup>How did I do? [Good](https://app.dosu.dev/response-feedback/776edabb-a716-4263-9b9a-05fe6c8cfa91?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/776edabb-a716-4263-9b9a-05fe6c8cfa91?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/776edabb-a716-4263-9b9a-05fe6c8cfa91?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/776edabb-a716-4263-9b9a-05fe6c8cfa91?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/776edabb-a716-4263-9b9a-05fe6c8cfa91?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/776edabb-a716-4263-9b9a-05fe6c8cfa91?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/776edabb-a716-4263-9b9a-05fe6c8cfa91?feedback_type=other)</sup> [![Open in Cursor](https://dosu.dev/dosu-in-cursor.svg)](https://cursor.com/link/prompt?text=Dify%20%E7%9A%84%20HTTP%20%E7%BB%84%E4%BB%B6%E4%BC%9A%E6%8A%8A%20HTTP%20%E5%93%8D%E5%BA%94%E7%9A%84%E6%89%80%E6%9C%89%20headers%EF%BC%88%E5%8C%85%E6%8B%AC%20Set-Cookie%EF%BC%89%E4%BD%9C%E4%B8%BA%20outputs%20%E8%BF%94%E5%9B%9E%EF%BC%8C%E6%89%80%E4%BB%A5%E4%BD%A0%E5%8F%AF%E4%BB%A5%E9%80%9A%E8%BF%87%20headers%20%E5%AD%97%E6%AE%B5%E8%8E%B7%E5%8F%96%E6%9C%8D%E5%8A%A1%E5%99%A8%E8%BF%94%E5%9B%9E%E7%9A%84%20cookie%20%E4%BF%A1%E6%81%AF%E3%80%82%E4%B8%8D%E8%BF%87%EF%BC%8C%E7%9B%AE%E5%89%8D%E6%B2%A1%E6%9C%89%E4%B8%93%E9%97%A8%E9%92%88%E5%AF%B9%20cookie%20%E7%9A%84%E7%8B%AC%E7%AB%8B%E6%8E%A5%E5%8F%A3%E6%88%96%E7%BB%93%E6%9E%84%EF%BC%8C%E6%89%80%E6%9C%89%20cookie%20%E9%83%BD%E4%BD%9C%E4%B8%BA%20headers%20%E7%9A%84%E4%B8%80%E9%83%A8%E5%88%86%E6%9A%B4%E9%9C%B2%E3%80%82%E4%BE%8B%E5%A6%82%EF%BC%9A%0A%0A%60%60%60python%0Aoutputs%20%3D%20%7B%0A%20%20%20%20%22status_code%22%3A%20response.status_code%2C%0A%20%20%20%20%22body%22%3A%20response.text%2C%0A%20%20%20%20%22headers%22%3A%20response.headers%2C%20%20%23%20%E8%BF%99%E9%87%8C%E5%8C%85%E5%90%AB%20Set-Cookie%0A%20%20%20%20%22files%22%3A%20files%2C%0A%7D%0A%60%60%60%0A%0A%E4%BD%A0%E5%8F%AF%E4%BB%A5%E5%9C%A8%20headers%20%E9%87%8C%E6%9F%A5%E6%89%BE%20Set-Cookie%20%E5%AD%97%E6%AE%B5%E6%9D%A5%E8%8E%B7%E5%8F%96%20cookie%20%E4%BF%A1%E6%81%AF%E3%80%82%E5%85%B7%E4%BD%93%E5%AE%9E%E7%8E%B0%E5%8F%AF%E5%8F%82%E8%80%83%20%5B%E6%BA%90%E7%A0%81%5D%28https%3A//github.com/langgenius/dify/blob/c75a4e6309de08474dc2c6951cbd4a52e92514e5/api/core/workflow/nodes/http_request/node.py%23L89-L128%29%20%E5%92%8C%20%5BResponse%20%E7%B1%BB%5D%28https%3A//github.com/langgenius/dify/blob/c75a4e6309de08474dc2c6951cbd4a52e92514e5/api/core/workflow/nodes/http_request/entities.py%23L96-L102%29%E3%80%82%0A%0A%E5%A6%82%E6%9E%9C%E6%96%87%E6%A1%A3%E6%B2%A1%E6%9C%89%E6%98%8E%E7%A1%AE%E8%AF%B4%E6%98%8E%EF%BC%8C%E5%BB%BA%E8%AE%AE%E8%A1%A5%E5%85%85%E8%AF%B4%E6%98%8E%20headers%20%E5%AD%97%E6%AE%B5%E5%8C%85%E5%90%AB%E6%89%80%E6%9C%89%E5%93%8D%E5%BA%94%E5%A4%B4%EF%BC%88%E5%8C%85%E6%8B%AC%20cookie%EF%BC%89%E3%80%82)&nbsp;[![Join Discord](https://img.shields.io/badge/join-5865F2?logo=discord&logoColor=white&label=)](https://go.dosu.dev/discord-bot)&nbsp;[![Share on X](https://img.shields.io/badge/X-share-black)](https://twitter.com/intent/tweet?text=%40dosu_ai%20helped%20me%20solve%20this%20issue!&url=https%3A//github.com/langgenius/dify-docs/issues/534)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify-docs#271