{"library":"apache-airflow-providers-http","code":"from __future__ import annotations\n\nimport pendulum\n\nfrom airflow.models.dag import DAG\nfrom airflow.providers.http.operators.http import HttpOperator\nfrom airflow.providers.http.sensors.http import HttpSensor\n\n# NOTE: You need to create an HTTP connection in Airflow UI\n# Admin -> Connections -> + New Record\n# Conn Id: http_default\n# Conn Type: HTTP\n# Host: httpbin.org\n# For HTTPS, see the 'Configuring HTTPS is counter-intuitive' warning.\n\nwith DAG(\n    dag_id=\"http_example_dag\",\n    start_date=pendulum.datetime(2023, 1, 1, tz=\"UTC\"),\n    catchup=False,\n    schedule=None,\n    tags=[\"http\", \"example\"],\n) as dag:\n    # Use HttpOperator to make a GET request\n    http_get_task = HttpOperator(\n        task_id=\"http_get_request\",\n        http_conn_id=\"http_default\",\n        method=\"GET\",\n        endpoint=\"get\", # This will resolve to httpbin.org/get\n        data={\"param1\": \"value1\", \"param2\": \"value2\"},\n        response_check=lambda response: \"param1\" in response.text,\n        log_response=True,\n    )\n\n    # Use HttpSensor to wait for a specific response\n    http_sensor_task = HttpSensor(\n        task_id=\"http_sensor_check\",\n        http_conn_id=\"http_default\",\n        endpoint=\"status/200\", # This will resolve to httpbin.org/status/200\n        response_check=lambda response: response.status_code == 200,\n        poke_interval=5,\n        timeout=60,\n    )\n\n    http_get_task >> http_sensor_task\n","lang":"python","description":"This quickstart demonstrates how to use `HttpOperator` to perform a GET request and `HttpSensor` to poll an endpoint until a condition is met. Ensure you configure an Airflow HTTP connection named `http_default` pointing to `httpbin.org` (or your target API) before running.","tag":null,"tag_description":null,"last_tested":"2026-04-24","results":[{"runtime":"python:3.10-alpine","exit_code":0},{"runtime":"python:3.10-slim","exit_code":0},{"runtime":"python:3.11-alpine","exit_code":0},{"runtime":"python:3.11-slim","exit_code":0},{"runtime":"python:3.12-alpine","exit_code":0},{"runtime":"python:3.12-slim","exit_code":0},{"runtime":"python:3.13-alpine","exit_code":0},{"runtime":"python:3.13-slim","exit_code":0},{"runtime":"python:3.9-alpine","exit_code":0},{"runtime":"python:3.9-slim","exit_code":0}]}