Consuming HTTP Services in Python Transcripts
Chapter: The service landscape
Lecture: Service type: HTTP and REST
0:00 Alright, next up, the majority of services that you are going to see,
0:03 are going to be HTTP restful services.
0:06 Be careful using the word restful because just certain people
0:10 restful means very specific set of criteria,
0:13 that most HTTP Json based services don't actually meet.
0:17 Maybe they are 75% restful or whatever, so I am going to try to use HTTP services
0:22 but these are more or less restful services for their features,
0:26 even if they are not entirely complete.
0:29 So how does this work, well, we have our app, and again we are going to do
0:32 an HTTP request and again, this is going to go over HTTP
0:34 but this time it's going to be a get request and it's going to be a get request
0:38 against something that is a noun not a verb.
0:41 And this time we are going to request API/users/7
0:44 indicating we want the details about user 7 and what we are going to get back
0:48 from the server, is going to be a Json message with the name Michael and id 7,
0:54 presumably, we even get more information,
0:57 but just keeping it simple for the slides here.
0:59 So what are the benefits? Well, there are many.
1:02 This is universally accessible, this service is universally accessible,
1:06 almost every platform has decent support for basic HTTP string exchange.
1:17 as well as C, ObjectiveC, swift, you name it, we can call this function
1:23 from basically anything that will talk to a network.
1:28 Because it's HTTP and it follows the get post put standard HTTP verbs,
1:31 it's firewall friendly, proxy friendly and for example this request is potentially cashable.
1:36 Reading this message name Michael id 7, is ridiculously easy,
1:41 it's entirely human readable, and while it's not as light weight
1:45 as the binary exchange it's dramatically more lightweight than what we would get
1:51 if this was a Soap message,
1:53 I've put this in the relatively light weight bandwidth story.
1:57 There is some drawbacks, it's often that you will find these services
2:02 that are not self-describing, there is some tooling called swagger
2:05 that you can add to the server's side and then use some tooling on the client side
2:09 to help describe and generate proxies and things like that
2:13 but, generally speaking, these services are not self-describing and like I said,
2:17 if the thing you are absolutely maximizing is bandwidth exchange,
2:21 well maybe raw sockets would be that, but if it's got to go over the internet,
2:25 this is about as good as it's going to get.