The http request node of the dify workflow has an error #14340

Closed
opened 2026-02-21 19:16:47 -05:00 by yindo · 3 comments
Owner

Originally created by @YinSonglin1997 on GitHub (May 30, 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

0.15.3

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

I want to create a new document to my knowledge base through the http request node. With the help of the api document of the knowledge base, my request is as follows:

Image
But the workflow reports an error:

{"code": "bad_request_key_error", "message": "The browser (or proxy) sent a request that this server could not understand.", "status": 400}

Similarly, I conducted tests in Postman, but it was executed correctly and files were created in my knowledge base, as follows:

Image

May I ask what causes this? What should I do?

✔️ Expected Behavior

The document can be smoothly uploaded to the knowledge base through the http request node.

Actual Behavior

{"code": "bad_request_key_error", "message": "The browser (or proxy) sent a request that this server could not understand.", "status": 400}
Originally created by @YinSonglin1997 on GitHub (May 30, 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 0.15.3 ### Cloud or Self Hosted Self Hosted (Docker) ### Steps to reproduce I want to create a new document to my knowledge base through the http request node. With the help of the api document of the knowledge base, my request is as follows: ![Image](https://github.com/user-attachments/assets/101589e7-ed50-4c54-b421-3f76e74cc278) But the workflow reports an error: ``` {"code": "bad_request_key_error", "message": "The browser (or proxy) sent a request that this server could not understand.", "status": 400} ``` Similarly, I conducted tests in `Postman`, but it was executed correctly and files were created in my knowledge base, as follows: ![Image](https://github.com/user-attachments/assets/98eb7196-cb6a-47c0-965e-275fe2dcb96a) May I ask what causes this? What should I do? ### ✔️ Expected Behavior The document can be smoothly uploaded to the knowledge base through the http request node. ### ❌ Actual Behavior ``` {"code": "bad_request_key_error", "message": "The browser (or proxy) sent a request that this server could not understand.", "status": 400} ```
yindo added the outdated label 2026-02-21 19:16:47 -05:00
yindo closed this issue 2026-02-21 19:16:47 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (May 30, 2025):

The error bad_request_key_error with status 400 indicates that the server could not understand the request, usually due to malformed syntax or missing/incorrect keys in the request body. Since your request works in Postman but fails in the Dify workflow, the issue is likely due to differences in how the HTTP request node in Dify constructs and sends the request compared to Postman.

Based on the Dify codebase, the HTTP request node uses an Executor class to build and send requests, handling different body types including multipart/form-data for file uploads. If the request body or headers are not set up exactly as the API expects, the server may reject the request with a 400 error. This can happen if, for example, the form-data keys, file field names, or JSON structure do not match what the API requires, or if required fields are missing or misnamed. The Dify node also inserts a placeholder file if no files are present, which could cause issues if the API expects a specific file field name or format. See the relevant implementation details here.

To resolve this, carefully compare the raw request sent by Postman (which works) with the one sent by the Dify workflow. Pay close attention to the following:

  • The names and structure of form-data fields (including file field names).
  • The Content-Type header and boundaries.
  • The exact JSON structure in the body (if applicable).
  • Any required headers or authorization details.

If possible, capture the raw HTTP request from both Postman and Dify and compare them side by side. Adjust the Dify HTTP request node configuration to match the working Postman request as closely as possible, especially for multipart fields and file uploads.

If you continue to see the error, double-check that all required fields are present and correctly named in the Dify node configuration. The error is not caused by a known bug in Dify 0.15.3, and there are no similar reported issues or documentation notes about this specific problem.

If you need more targeted help, sharing the exact configuration of your Dify HTTP request node (with sensitive data redacted) and the raw request details from both Postman and Dify would help pinpoint the discrepancy.

To reply, just mention my name @dosu.


How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other  Join Discord Share on X

@dosubot[bot] commented on GitHub (May 30, 2025): <!-- Answer --> The error `bad_request_key_error` with status 400 indicates that the server could not understand the request, usually due to malformed syntax or missing/incorrect keys in the request body. Since your request works in Postman but fails in the Dify workflow, the issue is likely due to differences in how the HTTP request node in Dify constructs and sends the request compared to Postman. Based on the Dify codebase, the HTTP request node uses an Executor class to build and send requests, handling different body types including `multipart/form-data` for file uploads. If the request body or headers are not set up exactly as the API expects, the server may reject the request with a 400 error. This can happen if, for example, the form-data keys, file field names, or JSON structure do not match what the API requires, or if required fields are missing or misnamed. The Dify node also inserts a placeholder file if no files are present, which could cause issues if the API expects a specific file field name or format. See the relevant implementation details [here](https://github.com/langgenius/dify/blob/1d9c90089c7bc7ac7ab83c982c8889ee268f962e/api/core/workflow/nodes/http_request/executor.py). To resolve this, carefully compare the raw request sent by Postman (which works) with the one sent by the Dify workflow. Pay close attention to the following: - The names and structure of form-data fields (including file field names). - The Content-Type header and boundaries. - The exact JSON structure in the body (if applicable). - Any required headers or authorization details. If possible, capture the raw HTTP request from both Postman and Dify and compare them side by side. Adjust the Dify HTTP request node configuration to match the working Postman request as closely as possible, especially for multipart fields and file uploads. If you continue to see the error, double-check that all required fields are present and correctly named in the Dify node configuration. The error is not caused by a known bug in Dify 0.15.3, and there are no similar reported issues or documentation notes about this specific problem. If you need more targeted help, sharing the exact configuration of your Dify HTTP request node (with sensitive data redacted) and the raw request details from both Postman and Dify would help pinpoint the discrepancy. <!-- Dosu Comment Footer --> *To reply, just mention my name [@dosu](https://go.dosu.dev/dosubot).* --- <sup>How did I do? [Good](https://app.dosu.dev/response-feedback/cc1f8bf4-1b5e-405e-8c4c-ff2379e45d70?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/cc1f8bf4-1b5e-405e-8c4c-ff2379e45d70?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/cc1f8bf4-1b5e-405e-8c4c-ff2379e45d70?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/cc1f8bf4-1b5e-405e-8c4c-ff2379e45d70?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/cc1f8bf4-1b5e-405e-8c4c-ff2379e45d70?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/cc1f8bf4-1b5e-405e-8c4c-ff2379e45d70?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/cc1f8bf4-1b5e-405e-8c4c-ff2379e45d70?feedback_type=other)</sup>&nbsp;&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/issues/20504)
Author
Owner

@crazywoola commented on GitHub (May 30, 2025):

Please check the json string in the form, there must be a extra , in the form.

@crazywoola commented on GitHub (May 30, 2025): Please check the json string in the form, there must be a extra `,` in the form.
Author
Owner

@YinSonglin1997 commented on GitHub (May 30, 2025):

I checked again to make sure there were no format errors. Moreover, the content of Postman is consistent with the content of the http request node in dify. Have you tested it successfully? The values of data are as follows:

{"indexing_technique":"high_quality","process_rule":{"rules":{"pre_processing_rules":[{"id":"remove_extra_spaces","enabled":true},{"id":"remove_urls_emails","enabled":true}],"segmentation":{"separator":"###","max_tokens":500}},"mode":"custom"}}
@YinSonglin1997 commented on GitHub (May 30, 2025): I checked again to make sure there were no format errors. Moreover, the content of `Postman` is consistent with the content of the http request node in dify. Have you tested it successfully? The values of `data` are as follows: ``` {"indexing_technique":"high_quality","process_rule":{"rules":{"pre_processing_rules":[{"id":"remove_extra_spaces","enabled":true},{"id":"remove_urls_emails","enabled":true}],"segmentation":{"separator":"###","max_tokens":500}},"mode":"custom"}} ```
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#14340