diff --git a/task-sdk/src/airflow/sdk/api/client.py b/task-sdk/src/airflow/sdk/api/client.py index 539d07f764a2b..fece35271f554 100644 --- a/task-sdk/src/airflow/sdk/api/client.py +++ b/task-sdk/src/airflow/sdk/api/client.py @@ -914,7 +914,9 @@ def _update_auth(self, response: httpx.Response): def request(self, *args, **kwargs): """Implement a convenience for httpx.Client.request with a retry layer.""" # Set content type as convenience if not already set - if "content" in kwargs and "headers" not in kwargs: + if kwargs.get("content", None) is not None and "content-type" not in ( + kwargs.get("headers", {}) or {} + ): kwargs["headers"] = {"content-type": "application/json"} return super().request(*args, **kwargs)