Consume Response Content
Understand how to use Python's built-in JSON library to parse response data.
Until now, we’ve just been printing out the response content (the response body) as a string. That’s fine when trying to understand the structure of the body. However, once ready to use the response body as part of our application, we’ll require a way to extract the data into our application’s data model objects.
Since JSON is the most commonly used format for the response content, we’ll be focusing on working with the body in JSON format. We’ll be using the air quality service provided by MET Norway. The URI is as follows:
https://api.met.no/weatherapi/airqualityforecast/0.1/stations.
Python provides a JSON library that can convert a JSON string into a Python ...
Access this course and 1400+ top-rated courses and projects.