简体   繁体   中英

Foodb api fetch react native

Hello I am a beginner in mobile app development. I am doing project in react native.In my app I need to fetch the food details from foodb website using API. I tried in postman to get response but I am getting error.

在 foodb 网站上,他们提供了这样的信息,但我收到了 Api 丢失错误

在此处输入图像描述

Error:

  {
    "error": "food_name is missing, api_key is missing"
}

Kindly guide me to resolve this problem. Thanks in Advance

You have to add parameter as query parameters:

curl -X GET 'https://foodb.ca/api/v1/foodreport/food?food_name=Angelicaa&api_key=d9b6cec3eb561db6f920a0797ba49f3e'

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM