From 00d446d9513e9bad8f4bad3be243770bedc63c0c Mon Sep 17 00:00:00 2001 From: kimtaewoong Date: Wed, 28 May 2025 00:01:35 +0900 Subject: [PATCH] fix(http): force multipart/form-data even without files(#20322) --- api/core/workflow/nodes/http_request/executor.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/api/core/workflow/nodes/http_request/executor.py b/api/core/workflow/nodes/http_request/executor.py index 2c42f5a1be..34a6dd8175 100644 --- a/api/core/workflow/nodes/http_request/executor.py +++ b/api/core/workflow/nodes/http_request/executor.py @@ -235,6 +235,10 @@ class Executor: files[key].append(file_tuple) # convert files to list for httpx request + # If there are no actual files, we still need to force httpx to use `multipart/form-data`. + # This is achieved by inserting a harmless placeholder file that will be ignored by the server. + if not files: + self.files = [("__multipart_placeholder__", ("", b"", "application/octet-stream"))] if files: self.files = [] for key, file_tuples in files.items():