TOML to JSON
Try it interactively →POST /api/toml-to-jsonParse a TOML document into JSON. Tables become objects, arrays-of-tables become arrays-of-objects. TOML date/time values are emitted as ISO-8601 strings.
Inputs
| Name | Type | Default | Description |
|---|---|---|---|
| toml* | string | — | TOML source. |
Response
Modes: json. Cache: yes (24h TTL).
Code samples
Built from the config example.
curl -X POST https://api.xtract.bot/api/toml-to-json \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "X-Account-Id: $XTRACT_ACCOUNT_ID" \
-H "X-Api-Key: $XTRACT_API_KEY" \
-d '{
"toml": "title = \"config\"\n[server]\nhost = \"0.0.0.0\"\nport = 8080\nfeatures = [\"a\", \"b\"]\n"
}'