Weather by API-Ninjas

フリーミアム
よって API Ninjas Team | 更新済み месяц назад | Weather
人気

9.8 / 10

レイテンシー

654ms

サービスレベル

100%

Health Check

N/A

すべてのディスカッションに戻る

Solved Error "Syntax Error"

Rapid account: Aayush 9119
aayush9119
a year ago

// 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));

Rapid account: Aellysijapati 12
aellysijapati12 Commented a year ago

just need to use " " double quote instead of ’ ’ one then it works perfectly

ディスカッションに参加しましょう-以下にコメントを追加してください:

ログイン/サインアップして新しいコメントを投稿