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 2020/05/20 22:40:49 UTC

[GitHub] [airflow] ashb commented on issue #8861: HttpHook.run method doesn't convert dict in 'data' parameter to json object

ashb commented on issue #8861:
URL: https://github.com/apache/airflow/issues/8861#issuecomment-631766490


   I don't think anything needs doing, the hook already supports extra arguments https://github.com/apache/airflow/blob/96697180d79bfc90f6964a8e99f9dd441789177c/airflow/hooks/http_hook.py#L100-L101
   
   The request docs you linked to:
   
   > :param data: the body to attach to the request. If a dictionary or
   >        list of tuples ``[(key, value)]`` is provided, form-encoding will
   >        take place.
   
   Passing data is doing what is says -- _form_ encoding, as if this was a `<form>`  submitted by a browser.
   
   If you want to submit json as the body, do `hook.run(json={'a': [1,2,3]})'


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