http_request node load json bug #6483

Closed
opened 2026-02-21 18:15:57 -05:00 by yindo · 3 comments
Owner

Originally created by @lyq518 on GitHub (Oct 31, 2024).

Self Checks

  • This is only for bug report, if you would like to ask a question, please head to Discussions.
  • I have searched for existing issues search for existing issues, including closed ones.
  • I confirm that I am using English to submit this report (我已阅读并同意 Language Policy).
  • [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:)
  • Please do not modify this template :) and fill in all the required fields.

Dify version

0.10.2

Cloud or Self Hosted

Self Hosted (Source)

Steps to reproduce

1730377529446
Sometimes an error occurs when the json data contains line breaks, which did not exist in previous versions.

✔️ Expected Behavior

1730377733931

Actual Behavior

No response

Originally created by @lyq518 on GitHub (Oct 31, 2024). ### Self Checks - [X] This is only for bug report, if you would like to ask a question, please head to [Discussions](https://github.com/langgenius/dify/discussions/categories/general). - [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 (我已阅读并同意 [Language Policy](https://github.com/langgenius/dify/issues/1542)). - [X] [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:) - [X] Please do not modify this template :) and fill in all the required fields. ### Dify version 0.10.2 ### Cloud or Self Hosted Self Hosted (Source) ### Steps to reproduce ![1730377529446](https://github.com/user-attachments/assets/0b37d2c7-12c4-4776-9dac-edff5cc5e3f0) Sometimes an error occurs when the json data contains line breaks, which did not exist in previous versions. ### ✔️ Expected Behavior ![1730377733931](https://github.com/user-attachments/assets/c96c18c4-a9dc-4679-9a7e-219965b29060) ### ❌ Actual Behavior _No response_
yindo added the 🐞 bugstaleoutdated labels 2026-02-21 18:15:57 -05:00
yindo closed this issue 2026-02-21 18:15:57 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Oct 31, 2024):

Hello @lyq518! I'm here to help you with any bugs, questions, or contributions you may have for Dify. Feel free to ask for assistance while waiting for a human maintainer.

I found a similar issue related to newline characters in JSON data within the HTTP request node. The issue titled 'Newline' not escaped when passed as string to HTTP request was closed, and the suggested solution was to manually escape newline characters in your input data or verify how the server interprets the received JSON payload. This ensures that newline characters are correctly understood by the server, aligning with the JSON specification's requirements for character escaping [1].

Additionally, the HTTP request node in Dify handles JSON data by parsing it through the _init_body method, where newline characters are managed by the json.loads function, which correctly parses them as part of the JSON data structure [2].

If you're experiencing issues with newline characters in version 0.10.2, you might want to check if the JSON data is being correctly formatted and escaped before being processed by the HTTP request node.

To continue talking to Dosu, mention @dosu.

@dosubot[bot] commented on GitHub (Oct 31, 2024): <!-- Greeting --> Hello @lyq518! I'm here to help you with any bugs, questions, or contributions you may have for Dify. Feel free to ask for assistance while waiting for a human maintainer. <!-- Answer --> I found a similar issue related to newline characters in JSON data within the HTTP request node. The issue titled ['Newline' not escaped when passed as string to HTTP request](https://github.com/langgenius/dify/issues/4122) was closed, and the suggested solution was to manually escape newline characters in your input data or verify how the server interprets the received JSON payload. This ensures that newline characters are correctly understood by the server, aligning with the JSON specification's requirements for character escaping <sup>[[1]](https://github.com/langgenius/dify/issues/4122)</sup>. Additionally, the HTTP request node in Dify handles JSON data by parsing it through the `_init_body` method, where newline characters are managed by the `json.loads` function, which correctly parses them as part of the JSON data structure <sup>[[2]](https://github.com/langgenius/dify/blob/main/api/core/workflow/nodes/http_request/executor.py)</sup>. If you're experiencing issues with newline characters in version 0.10.2, you might want to check if the JSON data is being correctly formatted and escaped before being processed by the HTTP request node. <!-- Dosu Comment Footer --> *To continue talking to [Dosu](https://dosu.dev), mention @dosu.*
Author
Owner

@nne998 commented on GitHub (Nov 4, 2024):

  • bug
@nne998 commented on GitHub (Nov 4, 2024): + bug
Author
Owner

@dosubot[bot] commented on GitHub (Dec 6, 2024):

Hi, @lyq518. I'm Dosu, and I'm helping the Dify team manage their backlog and am marking this issue as stale.

Issue Summary

  • A bug in the http_request node of Dify version 0.10.2 causes errors with JSON data containing line breaks.
  • This issue was not present in earlier versions of Dify.
  • I suggested ensuring newline characters are correctly escaped, referencing a similar closed issue.
  • The issue has been labeled as a bug by @nne998.

Next Steps

  • Please confirm if this issue is still relevant to the latest version of the Dify repository. If it is, you can keep the discussion open by commenting on this issue.
  • If there is no further activity, the issue will be automatically closed in 15 days.

Thank you for your understanding and contribution!

@dosubot[bot] commented on GitHub (Dec 6, 2024): Hi, @lyq518. I'm [Dosu](https://dosu.dev), and I'm helping the Dify team manage their backlog and am marking this issue as stale. **Issue Summary** - A bug in the `http_request` node of Dify version 0.10.2 causes errors with JSON data containing line breaks. - This issue was not present in earlier versions of Dify. - I suggested ensuring newline characters are correctly escaped, referencing a similar closed issue. - The issue has been labeled as a bug by @nne998. **Next Steps** - Please confirm if this issue is still relevant to the latest version of the Dify repository. If it is, you can keep the discussion open by commenting on this issue. - If there is no further activity, the issue will be automatically closed in 15 days. Thank you for your understanding and contribution!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#6483