AutoGPT is the vision of accessible AI for everyone, to use and to build on. Our mission is to provide the tools, so that you can focus on what matters.
fix: handle empty 204 responses in SendWebRequestBlock (#9887)
Mareddy Lohith Reddyd5dc6874843e
diff --git a/autogpt_platform/backend/backend/blocks/http.py b/autogpt_platform/backend/backend/blocks/http.pyindex 11aa56ae59..fa6e44d4e6 100644--- a/autogpt_platform/backend/backend/blocks/http.py+++ b/autogpt_platform/backend/backend/blocks/http.py@@ -82,7 +82,15 @@ class SendWebRequestBlock(Block):json=body if input_data.json_format else None,data=body if not input_data.json_format else None,)- result = response.json() if input_data.json_format else response.text++ if input_data.json_format:+ if response.status_code == 204 or not response.content.strip():+ result = None+ else:+ result = response.json()+ else:+ result = response.text+yield "response", resultexcept HTTPError as e: