Recipe - Food - Nutrition

FREEMIUM
Verified
By David | Updated 15 giorni fa | Food
Popularity

9.9 / 10

Latency

487ms

Service Level

100%

Health Check

N/A

Back to All Discussions

Error 404 for get request of recipe information

Rapid account: Parynaz
parynaz
7 anni fa

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;
},

Rapid account: Parynaz
parynaz Commented 7 anni fa

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)

		details: function(id) {return $http.get("https://spoonacular-recipe-food-nutrition-v1.p.mashape.com/recipes/" + id + "/information", {params: {'includeNutrition': true }}).then(
			function(information) {
				var details = information.data;
				return details;
Rapid account: Spoonacular
spoonacular Commented 7 anni fa

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

Join in the discussion - add comment below:

Login / Signup to post new comments