create objectblock to add multiple property:value pairs simultaneously.
"followed by a colon
:. The properties of the object is follows the colon
:but is within the
"cod"are simple properties of the JSON response.
"sys"are properties of the overall response, but each of these properties is also an object with properties of its own, or nested properties, contained within the
"weather"is a one-item list which also contains an object.
name) that we can retrieve and display in our app. Objects can be embedded within another object.
propertythat you are interested in. To get the name of the city we are viewing weather data for (
"name":in line 22), we'll want to get the property
nameof the response:
mainof the response object
main.tempof the response object:
"text"property in line 13, you'll have to:
"rows"property of the object
"elements"property of the rows object
"duration"property of the elements object
"text"property of the duration object
rows.elements.duration.textof the response: