Consuming HTTP Services in Python Transcripts
Chapter: Reading JSON data with requests
Lecture: Concept: Consuming GitHub JSON API
Login or
purchase this course
to watch this video and the rest of the course contents.
0:00
Let's review the core concepts about accessing Json services with Requests,
0:03
of course we are going to start by importing Request,
0:06
I have to have the url to the service that we are going to call,
0:10
in this case we are just going to do a basic get so we say request.get given the url,
0:13
we get our response back and we've worked with this already,
0:16
but the thing that is new this time is we now can call .json
0:20
and that will directly translate the text,
0:23
string representation of Json into a Python dictionary
0:27
and then we just work with the data in there
0:29
in our example we got the clone url for the get clone command
0:33
from wherever repository we were pointing at in the API.