Consuming HTTP Services in Python Transcripts
Chapter: Initial HTTP GET requests with the requests package
Lecture: Getting started with requests
Login or
purchase this course
to watch this video and the rest of the course contents.
0:01
The first type of services that we are going to focus on, not surprisingly are the most popular type, that is HTTP restful services,
0:09
and we are going to use a very popular package called Requests for our first look at it and then we'll come back later
0:15
and look at it through the eyes of the built ins. So where are we in our overall course map?
0:21
Well, we are talking about HTTP clients and right now we are focused on Requests.
0:25
You may have heard of Requests, Requests or HTTP for Humans as Kenneth puts it
0:30
is the most popular package for Python, not the most popular networking package,
0:33
it's the most popular package, it's been downloaded seven million times a month. So, it's really popular, and you can see that it has a very simple API
0:44
and the reason this exists is the built in urllib and urllib2 have some really funky APIs
0:52
and it's generally hard to work with, there is a lot of funkiness and it even gets less good,
0:57
if you will, in Python 3, rather than Python 2, so the built ins are not super joyous.
1:02
There are reasons to use them and we will talk about what those are and when,
1:06
but for our first look at HTTP services, we are going to absolutely use Requests. Like most Python packages, we are going to install Requests via pip,
1:16
so here you can see its projects page on PyPi, this is the newer version of PyPi at pypi.org/projects/requests
1:22
and it says to install it, we are just going to pip install requests, that's pretty straightforward, so let's go do that now.