LiveFetch functions send HTTP requests to a specified URL.
Authorization
header to pass a token.
If you choose to hardcode the credentials in the query, please make sure to keep the query private.
Optionally, you can use a query parameter as a placeholder:
http_get(url: varchar)
→ varchar
http_get(url: varchar, headers: array(varchar))
→ varchar
The function sends an HTTP GET request to the given URL, optionally including the provided headers,
and returns the response body as varchar
.
Often, the response is a JSON document. You can process it further with JSON-processing SQL functions.
Other response formats, like html, are also supported.
http_post(url: varchar, body: varchar)
→ varchar
http_post(url: varchar, body: varchar, headers: array(varchar))
→ varchar
The function sends an HTTP POST request to the given URL, including the provided data in the request body,
and optionally including the headers. It returns the response body as varchar
.
The type of the body argument is varchar
. It gives you flexibility to send JSON data as well as text.
http_post()
is 1_000_000 bytes.
http_get()
function in a subquery, you can use it as a static filter in the main query.
It helps to avoid repeating the same HTTP request multiple times.
'
character, you need to quote it properly because it is the bounding character of varchar
.
Each '
character should be doubled, and the query engine will unwrap them.