SimpleHttpOperator

HTTPCertified

Calls an endpoint on an HTTP system to execute an action

View on GitHub

Last Updated: May. 10, 2021

Access Instructions

Install the HTTP provider package into your Airflow environment.

Import the module into your DAG file and instantiate it with your desired params.

Parameters

http_conn_idstrThe connection to run the operator against
endpointstrThe relative part of the full url. (templated)
methodstrThe HTTP method to use, default = “POST”
dataFor POST/PUT, depends on the content-type parameter, for GET a dictionary of key/value string pairsThe data to pass. POST-data in POST/PUT and params in the URL for a GET request. (templated)
headersa dictionary of string key/value pairsThe HTTP headers to be added to the GET request
response_checkA lambda or defined function.A check against the ‘requests’ response object. The callable takes the response object as the first positional argument and optionally any number of keyword arguments available in the context dictionary. It should return True for ‘pass’ and False otherwise.
response_filterA lambda or defined function.A function allowing you to manipulate the response text. e.g response_filter=lambda response: json.loads(response.text). The callable takes the response object as the first positional argument and optionally any number of keyword arguments available in the context dictionary.
extra_optionsA 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_responseboolLog the response (default: False)

Documentation

Calls an endpoint on an HTTP system to execute an action

See also

For more information on how to use this operator, take a look at the guide: SimpleHttpOperator

Was this page helpful?