From 6b2c2a2cb59d0d843f2d52d7d650827b0b17832c Mon Sep 17 00:00:00 2001 From: Stanislav Novosad Date: Tue, 7 Oct 2025 10:41:19 -0600 Subject: [PATCH] Fix AsyncHttpClient sending empty body when everything OMITted (#3636) --- skyvern/client/core/http_client.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/skyvern/client/core/http_client.py b/skyvern/client/core/http_client.py index 275a54cc..ddd1be53 100644 --- a/skyvern/client/core/http_client.py +++ b/skyvern/client/core/http_client.py @@ -371,6 +371,16 @@ class AsyncHttpClient: json_body, data_body = get_request_body(json=json, data=data, request_options=request_options, omit=omit) + # If omit/pruning removed everything, still send {} for methods that commonly expect a body. + if ( + json_body is None + and data_body is None + and content is None + and files is None + and method.upper() in {"POST", "PUT", "PATCH"} + ): + json_body = {} + # Add the input to each of these and do None-safety checks response = await self.httpx_client.request( method=method,