gpt4 book ai didi

reactjs - 如何摆脱这个 - 消息 : {'You are not subscribed to this API.' }. ?

转载 作者:行者123 更新时间:2023-12-03 23:47:51 28 4
gpt4 key购买 nike

import React from 'react';
import './App.css';

function App() {
fetch("https://spoonacular-recipe-food-nutrition-v1.p.rapidapi.com/recipes/quickAnswer?q=How%20much%20vitamin%20c%20is%20in%202%20apples%253F", {
"method": "GET",
"headers": {
"x-rapidapi-host": "[host]",
"x-rapidapi-key": "[key]"
}
})
.then(response => {
console.log(response);
})
.catch(err => {
console.log(err);
});
return ( <
div className = "App" >
<
form className = 'searchform' >
<
input className = 'search-bar'
type = "text" / >
<
button className = 'search-bar'
type = 'text' > Submit < /button> < /
form > <
/div >
);
}

export default App;

最佳答案

如果您在 RapidAPI 上的所有设置都正确,我建议您在不使用变量的情况下传递 key ,因为也许您传递的是未定义的。对于 undefined 我们得到完全相同的错误。

关于reactjs - 如何摆脱这个 - 消息 : {'You are not subscribed to this API.' }. ?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61445875/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com