Get a receipe from a JSON Receipe API
Type stew into the Dish field to get a recipe for a stew.
Stack makes a free API call to a recipe API and returns the recipe.
Uses LiveCode tsNetPost to retrieve the text and picture of the recipe.
Get a recipe from a JSON Recipe API
put "https://cuisine-pal.up.railway.app/api/recipe/" into tUrl
put "{" & quote & "dish" & quote & ":" & quote & fld dish & quote & "}" into tPostData
put "Content-Type: application/json" into tHeaders
put tsNetPost(Ò1Ó,tUrl,tHeaders,tPostData,"postResponse") into tError
This is a rewrite of a Node js app that used the following curl call:
curl --location 'https://cuisine-pal.up.railway.app/api/recipe/' --header 'Content-Type: application/json' --data '{"dish":"Steak"}'