I'm learning how to use RapidAPI and I get the same problem. I'm trying to use Random Famous quotes with JavaScript fetch. I copy this code:
async componentDidMount() {
await fetch("https://andruxnet-random-famous-quotes.p.rapidapi.com/?count=10&cat=movies", {
"method": "POST",
"headers": {
"x-rapidapi-host": "andruxnet-random-famous-quotes.p.rapidapi.com",
"x-rapidapi-key": "5d4682bb48msh8e662b997230c75p180ff3jsne9e95966eb37",
"content-type": "application/x-www-form-urlencoded"
},
"body": {}
})
.then(response => {
console.log(response);
})
.catch(err => {
console.log(err);
});
And in the console this is the response:
body: ReadableStream { locked: false }
bodyUsed: false
headers: Headers { }
ok: true
redirected: false
status: 200
statusText: "OK"
type: "cors"
url: "https://andruxnet-random-famous-quotes.p.rapidapi.com/?count=10&cat=movies"
The url leads to the error: "message": "Missing RapidAPI application key. Go to https://docs.rapidapi.com/docs/keys to learn how to get your API application key."
It seems that the api key is missing, but as I understand it is provided in fetch headers. Is this is a syntax mistake or something else I'm missing? Thanks in advance.