【发布时间】:2020-08-10 05:46:10
【问题描述】:
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;
【问题讨论】:
-
订阅那个 API?此外,您现在需要轮换您刚刚公开共享的凭据。
-
@jonrsharpe 说了什么。 docs.rapidapi.com/docs/… 可能对这个 bt 有帮助我不确定,我以前没有使用过这个 api。
-
我面临同样的问题。您是否设法找到任何解决方案?