Welcome Guest (Log in)

Get Recipe App

StarStarStarStarStar
Json (4) | API (2) | Recipes (2) |
General
Expander triangle
  • Author
  • Rating
  • Type
  • Revision
  • Downloaded
  • Updated
  • Lloyd Merithew
  • StarStarStarStarStar
  • Stack
  • 2
  • 113 Times
  • 15 May 2023
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"}'
Ajax Loader
Tags
Expander triangle
User Comments
Expander triangle