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 2019/12/25 02:53:59 UTC

[GitHub] [airflow] zhongjiajie commented on a change in pull request #6886: [AIRFLOW-6327] http_hook: Accept json= parameter for payload

zhongjiajie commented on a change in pull request #6886: [AIRFLOW-6327] http_hook: Accept json= parameter for payload
URL: https://github.com/apache/airflow/pull/6886#discussion_r361245459
 
 

 ##########
 File path: airflow/hooks/http_hook.py
 ##########
 @@ -75,20 +75,24 @@ def get_conn(self, headers=None):
                 try:
                     session.headers.update(conn.extra_dejson)
                 except TypeError:
-                    self.log.warning('Connection to %s has invalid extra field.', conn.host)
+                    self.log.warning(
+                        'Connection to %s has invalid extra field.', conn.host)
         if headers:
             session.headers.update(headers)
 
         return session
 
-    def run(self, endpoint, data=None, headers=None, extra_options=None):
+    def run(self, endpoint, data=None, json=None, headers=None, extra_options=None):
         """
         Performs the request
 
         :param endpoint: the endpoint to be called i.e. resource/v1/query?
         :type endpoint: str
         :param data: payload to be uploaded or request parameters
         :type data: dict
+        :param json: Python object which is encoded and posted as JSON. Usually
+          this is a dict but can be any JSON-encodable Python object.
 
 Review comment:
   Four blank space will be better.

----------------------------------------------------------------
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


With regards,
Apache Git Services