This is an automated email from the ASF dual-hosted git repository.

potiuk pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git


The following commit(s) were added to refs/heads/main by this push:
     new 8695fc533d5 Add Content-Type to Request Header in Task SDK calls 
(#57377)
8695fc533d5 is described below

commit 8695fc533d5efd07952a670cafbb0f120639d0ba
Author: Jens Scheffler <[email protected]>
AuthorDate: Mon Oct 27 23:47:15 2025 +0100

    Add Content-Type to Request Header in Task SDK calls (#57377)
---
 task-sdk/src/airflow/sdk/api/client.py | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/task-sdk/src/airflow/sdk/api/client.py 
b/task-sdk/src/airflow/sdk/api/client.py
index d760c2f65df..d73c405cbe7 100644
--- a/task-sdk/src/airflow/sdk/api/client.py
+++ b/task-sdk/src/airflow/sdk/api/client.py
@@ -902,6 +902,10 @@ class Client(httpx.Client):
     )
     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

Reply via email to