diff --git a/task-sdk/src/airflow/sdk/api/client.py b/task-sdk/src/airflow/sdk/api/client.py index 6d71a7f106b9b..6c1134036d364 100644 --- a/task-sdk/src/airflow/sdk/api/client.py +++ b/task-sdk/src/airflow/sdk/api/client.py @@ -863,6 +863,10 @@ 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: + kwargs["headers"] = {"content-type": "application/json"} + return super().request(*args, **kwargs) # We "group" or "namespace" operations by what they operate on, rather than a flat namespace with all