DON’T USE GENERATED RAPIDAPI CODE
USE SOMETHING LIKE THIS:
const query = query { exercises( exerciseQuery: {force: "pull"} ) { name } }
const url = 'https://advanced-exercise-finder.p.rapidapi.com/'
const options = {
method: 'POST',
headers: {
'x-rapidapi-key': 'api-key',
'x-rapidapi-host': 'advanced-exercise-finder.p.rapidapi.com',
'Content-Type': 'application/json'
},
body: JSON.stringify({query:query})
}
try {
const response = await fetch(url, options);
const result = await response.text();
console.log(result);
} catch (error) {
console.error(error);
}
Join in the discussion - add comment below: