diff --git a/providers/src/airflow/providers/http/operators/http.py b/providers/src/airflow/providers/http/operators/http.py index 0ec9fd136c71..9979d9b8b527 100644 --- a/providers/src/airflow/providers/http/operators/http.py +++ b/providers/src/airflow/providers/http/operators/http.py @@ -143,6 +143,7 @@ def __init__( self.tcp_keep_alive_interval = tcp_keep_alive_interval self.deferrable = deferrable self.retry_args = retry_args + self.kwargs = kwargs @property def hook(self) -> HttpHook: @@ -173,10 +174,21 @@ def execute_sync(self, context: Context) -> Any: self.log.info("Calling HTTP method") if self.retry_args: response = self.hook.run_with_advanced_retry( - self.retry_args, self.endpoint, self.data, self.headers, self.extra_options + self.retry_args, + self.endpoint, + self.data, + self.headers, + self.extra_options, + **self.kwargs, ) else: - response = self.hook.run(self.endpoint, self.data, self.headers, self.extra_options) + response = self.hook.run( + self.endpoint, + self.data, + self.headers, + self.extra_options, + **self.kwargs, + ) response = self.paginate_sync(response=response) return self.process_response(context=context, response=response) @@ -303,7 +315,10 @@ def _merge_next_page_parameters(self, next_page_params: dict) -> dict: endpoint=next_page_params.get("endpoint") or self.endpoint, data=data, headers=merge_dicts(self.headers, next_page_params.get("headers", {})), - extra_options=merge_dicts(self.extra_options, next_page_params.get("extra_options", {})), + extra_options=merge_dicts( + self.extra_options, next_page_params.get("extra_options", {}) + ), + **self.kwargs, ) diff --git a/providers/src/airflow/providers/http/sensors/http.py b/providers/src/airflow/providers/http/sensors/http.py index 33b5e1d4defb..a2eec2012ceb 100644 --- a/providers/src/airflow/providers/http/sensors/http.py +++ b/providers/src/airflow/providers/http/sensors/http.py @@ -121,6 +121,7 @@ def __init__( self.tcp_keep_alive_count = tcp_keep_alive_count self.tcp_keep_alive_interval = tcp_keep_alive_interval self.deferrable = deferrable + self.kwargs = kwargs def poke(self, context: Context) -> bool: from airflow.utils.operator_helpers import determine_kwargs @@ -141,6 +142,7 @@ def poke(self, context: Context) -> bool: data=self.request_params, headers=self.headers, extra_options=self.extra_options, + **self.kwargs, ) if self.response_check: