The Polling HTTP source periodically polls an HTTP endpoint and emits the response as a record. This can be used to turn any HTTP API into a streaming data source.

Configuring the Connection

Polling HTTP sources can be created via the Web UI or directly in SQL.

polling http source creationg flow

An polling http connection has several required and optional fields:

endpointThe endpoint for the HTTP serverYes
headersA comma-separated list of colon separated key-value pairs of headers that will be sent to the serverNoContent-Type:application/json,Authorization: Bearer mytoken
methodThe HTTP method to use when polling the endpointNoGET
bodyThe body to send with the requestNo{"foo": "bar"}
poll_interval_msThe interval at which to poll the endpoint, in millisecondsNo5000
emit_behaviorControls when records are emitted; can be all or changedNochanged

For example, in SQL:

    value TEXT
) WITH (
    connector = 'polling_http',
    endpoint = '',
    poll_interval_ms = '5000',
    emit_behavior = 'changed',
    headers = 'User-Agent:arroyo/0.6',
    format = 'json',
    'json.unstructured' = 'true'