powered by
LOGO

$processor$: http

This processor is used to initialise some FTD variable with content of JSON fetched from HTTP.
⚠️
Static Vs Dynamic
The http request is made on build time if you are using fastn in static site mode, and instead if you are using server mode then this processor makes http request on every page load.
Consider this data type:
-- record repo:
string full_name:
string description:
string html_url:
integer stargazers_count:
integer watchers_count:

-- record result:
integer total_count: 0
repo list items:

-- result r:
We have two records: repo, and result. We also have a variable of type result.

Lets initialise this variable with result of fetching the top repositories from Github:

-- r:
$processor$: http
url: https://api.github.com/search/repositories
sort: stars
order: desc
q: language:python

url: string
This is the URL where we would be fetching the JSON from. It is mandatory.

Key: Value pairs
Each key value pair is passed added to the URL as query params.

The response of the JSON must match with type of the variable where we are storing the result, here it is r of type record defined above.

LOGO

$processor$: http

This processor is used to initialise some FTD variable with content of JSON fetched from HTTP.
⚠️
Static Vs Dynamic
The http request is made on build time if you are using fastn in static site mode, and instead if you are using server mode then this processor makes http request on every page load.
Consider this data type:
-- record repo:
string full_name:
string description:
string html_url:
integer stargazers_count:
integer watchers_count:

-- record result:
integer total_count: 0
repo list items:

-- result r:
We have two records: repo, and result. We also have a variable of type result.

Lets initialise this variable with result of fetching the top repositories from Github:

-- r:
$processor$: http
url: https://api.github.com/search/repositories
sort: stars
order: desc
q: language:python

url: string
This is the URL where we would be fetching the JSON from. It is mandatory.

Key: Value pairs
Each key value pair is passed added to the URL as query params.

The response of the JSON must match with type of the variable where we are storing the result, here it is r of type record defined above.