non-JSON response #12851

Closed
opened 2026-02-21 19:09:23 -05:00 by yindo · 2 comments
Owner

Originally created by @hiep-wjl on GitHub (Apr 13, 2025).

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

V1.1.3

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

When utilizing the Postman API to invoke a model, the expected response format is a properly structured JSON object. However, upon integration of this API call into a plugin, the plugin encounters an error where it does not receive the expected JSON input. Instead, it receives a non-JSON response, which is causing the integration to fail. The objective is to troubleshoot and resolve the issue to ensure that the plugin correctly processes the JSON response from the Postman API call.

Image

Image

✔️ Expected Behavior

No response

Actual Behavior

No response

Originally created by @hiep-wjl on GitHub (Apr 13, 2025). ### 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 V1.1.3 ### Cloud or Self Hosted Self Hosted (Docker) ### Steps to reproduce When utilizing the Postman API to invoke a model, the expected response format is a properly structured JSON object. However, upon integration of this API call into a plugin, the plugin encounters an error where it does not receive the expected JSON input. Instead, it receives a non-JSON response, which is causing the integration to fail. The objective is to troubleshoot and resolve the issue to ensure that the plugin correctly processes the JSON response from the Postman API call. ![Image](https://github.com/user-attachments/assets/75d75406-0c6c-46b4-815d-5c77050046ac) ![Image](https://github.com/user-attachments/assets/bdeed115-2a2f-4a17-b911-10fd9d7113ad) ### ✔️ Expected Behavior _No response_ ### ❌ Actual Behavior _No response_
yindo added the 🐞 bug label 2026-02-21 19:09:23 -05:00
yindo closed this issue 2026-02-21 19:09:23 -05:00
Author
Owner

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

Hello @hiep-wjl! I'm Dosu, your friendly bot here to assist you with bugs, questions, and contributions while you wait for a human maintainer. How can I help you today?

A similar issue has been discussed in the Dify repository, where non-JSON responses were encountered when using the API. One common cause of malformed JSON responses is using the 'raw' body format in the HTTP request node when the query contains special characters like newlines ('\n'). Changing the body format from 'raw' to 'JSON' in the HTTP request node configuration can fix this issue by ensuring proper escaping of special characters in the query string [1].

Additionally, when using a custom API in Http Node, responses may appear non-streaming due to latency in the Http Node processing. This is expected behavior and not a streaming functionality issue. Ensure that you are handling the streaming responses correctly and consider using a variable aggregator if you have multiple conditional branches [2][3].

You might want to check these aspects in your setup to resolve the non-JSON response issue.

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 13, 2025): <!-- Greeting --> Hello @hiep-wjl! I'm [Dosu](https://dosu.dev), your friendly bot here to assist you with bugs, questions, and contributions while you wait for a human maintainer. How can I help you today? <!-- Answer --> A similar issue has been discussed in the Dify repository, where non-JSON responses were encountered when using the API. One common cause of malformed JSON responses is using the 'raw' body format in the HTTP request node when the query contains special characters like newlines ('\n'). Changing the body format from 'raw' to 'JSON' in the HTTP request node configuration can fix this issue by ensuring proper escaping of special characters in the query string <sup>[[1]](https://github.com/langgenius/dify/issues/11643)</sup>. Additionally, when using a custom API in Http Node, responses may appear non-streaming due to latency in the Http Node processing. This is expected behavior and not a streaming functionality issue. Ensure that you are handling the streaming responses correctly and consider using a variable aggregator if you have multiple conditional branches <sup>[[2]](https://github.com/langgenius/dify/issues/16071)</sup><sup>[[3]](https://github.com/langgenius/dify/issues/15351)</sup>. You might want to check these aspects in your setup to resolve the non-JSON response issue. <!-- 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/017f3569-5c24-47ca-82e6-cbdc365f4c1b?feedback_type=great_response) | [Irrelevant Answer](https://app.dosu.dev/response-feedback/017f3569-5c24-47ca-82e6-cbdc365f4c1b?feedback_type=irrelevant_answer) | [Incorrect Sources](https://app.dosu.dev/response-feedback/017f3569-5c24-47ca-82e6-cbdc365f4c1b?feedback_type=incorrect_sources) | [Too Verbose](https://app.dosu.dev/response-feedback/017f3569-5c24-47ca-82e6-cbdc365f4c1b?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/017f3569-5c24-47ca-82e6-cbdc365f4c1b?feedback_type=hallucination) | [Bug Report](https://app.dosu.dev/response-feedback/017f3569-5c24-47ca-82e6-cbdc365f4c1b?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/017f3569-5c24-47ca-82e6-cbdc365f4c1b?feedback_type=other)</sup>
Author
Owner

@hiep-wjl commented on GitHub (Apr 13, 2025):

here is the solution: set strem delimiter as '\r\n\r\n'

@hiep-wjl commented on GitHub (Apr 13, 2025): here is the solution: set strem delimiter as '\r\n\r\n'
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#12851