I get an error when I try to do a get request for recipe information using the id. I’m not sure what is wrong here, because it goes through but returns an error. I even tried to change the curly braces on the id to %7B and %7D but it didn’t work either. Thanks
return $http.get(“https://spoonacular-recipe-food-nutrition-v1.p.mashape.com/recipes/{id}/information”,
{params: {‘id’ : id, ‘includeNutrition’: true }}).then(
function(payload) {
var recipes = payload.data;
return recipes;
},
Join in the discussion - add comment below:
Thank you. The problem was that the parameter for id was in the middle of the url so I just did this instead and it worked (for anyone else who has the same problem)
Hey parynaz, curly braces mean that this is a parameter and needs to be replaced. So to get information for the recipe with id 1234 you have to call …/recipes/1234/information