Tasty

免费增值
Verified
通过 Api Dojo | 已更新 17일 전 | Food
人气

9.7 / 10

延迟

2,310ms

服务等级

100%

Health Check

N/A

返回所有讨论

Don't know how to fetch data

const url = ‘https://platform.fatsecret.com/rest/server.api’;
const options = {
method: ‘GET’,
headers: {
‘X-RapidAPI-Key’: ‘eb5b7b5c8cfc48a08af5b9c39be760ff’,
‘X-RapidAPI-Host’: ‘tasty.p.rapidapi.com’,
‘Authorization’: Bearer ${key},
‘Content-Type’: ‘application/json’
}
};

    onMounted(() => {
        fetch(url, options)
            .then(response => response.json())
            .then(data => {
                characters.value = data //.results as Character[]
            })
            .catch(error => {
                console.error('Error fetching data:', error);
            });

    })

    console.log(characters.value);
Rapid account: Apidojo
apidojo Commented 7달 전

Hello, please have a look at https://docs.rapidapi.com/docs/basics-creating-a-project to get started.
Regards

加入讨论 - 在下面添加评论:

登录/注册以发布新的评论