airflow.operators.http_operator
¶
Module Contents¶
-
class
airflow.operators.http_operator.
SimpleHttpOperator
(endpoint:str, method:str='POST', data:Any=None, headers:Dict[str, str]=None, response_check:Callable=None, extra_options:Dict[str, Any]=None, http_conn_id:str='http_default', log_response:bool=False, *args, **kwargs)[source]¶ Bases:
airflow.models.BaseOperator
Calls an endpoint on an HTTP system to execute an action
- Parameters
http_conn_id (str) – The connection to run the operator against
endpoint (str) – The relative part of the full url. (templated)
method (str) – The HTTP method to use, default = “POST”
data (For POST/PUT, depends on the content-type parameter, for GET a dictionary of key/value string pairs) – The data to pass. POST-data in POST/PUT and params in the URL for a GET request. (templated)
headers (a dictionary of string key/value pairs) – The HTTP headers to be added to the GET request
response_check (A lambda or defined function.) – A check against the ‘requests’ response object. Returns True for ‘pass’ and False otherwise.
extra_options (A dictionary of options, where key is string and value depends on the option that's being modified.) – Extra options for the ‘requests’ library, see the ‘requests’ documentation (options to modify timeout, ssl, etc.)
log_response (bool) – Log the response (default: False)