Recipe - Food - Nutrition

ÜCRETSİZ PREMIUM
Verified
Taraf David | Güncelleyen לפני 23 ימים | Food
Popülerlik

9.9 / 10

Gecikme

1,410ms

Hizmet Düzeyi

100%

Health Check

N/A

Tüm Tartışmalara Dön

How to pass ingredientList to /visualizeNutrition/ API endpoint

Rapid account: Dapicester
dapicester
לפני 7 שנים

Hi,
today I started using your API, and I have a problem with the visualizeNutrition endpoint.
If I try the example on Mashape:

curl -X POST --include 'https://spoonacular-recipe-food-nutrition-v1.p.mashape.com/recipes/visualizeIngredients' \
  -H 'X-Mashape-Key: foobarbaz' \
  -H 'Accept: text/html' \
  -H 'Content-Type: application/x-www-form-urlencoded' \
  -d 'defaultCss=true' \
  -d 'ingredientList=3 oz flour' \
  -d 'measure=metric' \
  -d 'servings=2' \
  -d 'showBacklink=true' \
  -d 'view=grid'

it works fine, but as you see there is only one ingredient.

The documentation says:

The ingredient list of the recipe, one ingredient per line.

So I did try in many different ways but non of them actually worked:

  1. -d 'ingredientList=3 oz flour' -d 'ingredientList=1 cup skimmed butter'
  2. -d 'ingredientList[]=3 oz flour' -d 'ingredientList[]=1 cup skimmed butter'
  3. -d 'ingredientList=1cup lard^M1 kg of chicken breast'
  4. -d 'ingredientList=1 cup lard\n1 kg of chicken breast'
  5. -d $'ingredientList=1cup lard\n1 kg of chicken breast'

So here is the question in the title: how do I pass a list of ingredients into ingredientList?

Rapid account: Spoonacular
spoonacular Commented לפני 7 שנים

Number 4 works for me though.

Aşağıya yorum ekleyerek tartışmaya katılın:

Yeni yorumlar göndermek için giriş yapın / kaydolun