// Use this one.
onst url = ‘https://weather-by-api-ninjas.p.rapidapi.com/v1/weather?city=Lucknow’;
const options = {
method: ‘GET’,
headers: {
‘content-type’: ‘application/octet-stream’,
‘X-RapidAPI-Key’: ‘763c810bdfmshb9f4669b80c3925p18d818jsn3db5be365864’,
‘X-RapidAPI-Host’: ‘weather-by-api-ninjas.p.rapidapi.com’
}
};
fetch(url, options)
.then(response => response.json())
.then(response => console.log(response))
.catch(err => console.error(err));
Приєднуйтесь до обговорення — додайте повідомлення нижче:
just need to use " " double quote instead of ’ ’ one then it works perfectly