skip to Main Content

Json – node js error Cannot read property 'temp' of undefined open weather api

`const express = require("express"); const https = require("https"); const app = express(); app.get("/", function (req, res) { const url = "https://api.openweathermap.org/data/2.5/forecast?q=delhi&appid={apikey}&units=metric"; https.get(url, function (response) { console.log(response.statusCode); response.on("data", function(data){ const weatherData = JSON.parse(data); console.log(weatherData); const Temp = weatherData.main.temp; console.log(Temp); }); });…

VIEW QUESTION

Json – XSuperObject: what's wrong with this date field?

unit fmainForm; interface uses Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics, Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls; type TForm1 = class(TForm) Memo1: TMemo; procedure FormCreate(Sender: TObject); private { Private declarations } public { Public declarations } end; var Form1: TForm1; implementation {$R *.dfm}…

VIEW QUESTION
Back To Top
Search