You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2021/03/11 12:37:05 UTC
[GitHub] [airflow] ngaranko commented on a change in pull request #14701: HttpHook. Use request factory and respect defaults
ngaranko commented on a change in pull request #14701:
URL: https://github.com/apache/airflow/pull/14701#discussion_r592324754
##########
File path: airflow/providers/http/hooks/http.py
##########
@@ -126,15 +126,20 @@ def run(
else:
url = (self.base_url or '') + (endpoint or '')
+ request_parameters = dict(method=self.method, url=url, headers=headers)
+ request_parameters.update(request_kwargs)
+
if self.method == 'GET':
# GET uses params
- req = requests.Request(self.method, url, params=data, headers=headers, **request_kwargs)
+ request_parameters["params"] = data
elif self.method == 'HEAD':
# HEAD doesn't use params
- req = requests.Request(self.method, url, headers=headers, **request_kwargs)
+ pass
Review comment:
HEAD requests are still made, it's just they do no require data to be added into payload, hence the `pass`.
Request instance is created later via `session.request` factory.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org