Skip to main content

Hello! I have no idea to how use fetch api with key

 

 connectedCallback() {

      fetch("https://api.spoonacular.com/recipes/random?apiKey=ec176c60db384bfdb8eb7a2b149f063b")

      .then((res)=>{

 

  return res.json()

      }) 

How use fetch api with keys

 

3 answers
  1. Apr 11, 2023, 4:53 AM
    Please don't use fetch api when you need to use username/password or in your case, API key. For such cases, always use Apex to make a callout.
0/9000