Demystifying the REST API
Are you confused by REST APIs? Can't tell a PUT from a POST? No idea what a non-idempotent operation is? Despite their ubiquity, the details of what makes an API RESTful are often lost even on experienced developers. We'll cover the basics of the HTTP protocol that drives most REST services, break down the lingo, and clear up some misconceptions about this powerful and popular methodology.
I really enjoyed this talk. Samantha did a fantastic job of presenting this broad range of information in a compressed format. While it was not any new information for me personally it is the type of presentation I would like to have all of the developers on our team see first hand. REST and HTTP are not actually a complicated topics but sadly most developers are lack a fundamental understanding of both. The slide deck was comprehensive but not wordy. I would definitely attend another talk by Samantha.
My notes for this talk can be found below:
- brief overview of what we are talking about REST
- text/language is the greatest invention of man kind
- text is a tool
- text allows us to “communicate” with people who have been dead for thousands of years
- people understand text and can use it to measure something like how large digital storage is by how many encyclopedias could fit on a disc.
- hypertext is the second greatest invention of man kind
- Roy Fielding – part of a working group that defined HTTP 1.0 spec. His dissertation describes REST architectural pattern
- client (UI) <—> server (data) – separation of concerns
- statelessness – each requests from the client to the server has to contain all information that the server needs to fulfill the request.
- caching is use to reduce messaging overhead
- the server should tell the client how long to cache something for. or at least provide a hash that can be used to determine if something has changed.
- layering – any component in the system is unaware of the existence of the layers
- code on demand – the server returns code that the client can run (ex. JavaScript, CSS)
- JSON+HAL – an attempt to solve the issue of JSON not being a hypertext format
- HTTP 1.1 was released in 1999 – includes 9 methods (verbs). patch and connect are not wildly used.
- methods are grouped in two ways, safe/unsafe and idempotent
- put vs post – read the spec
- Beginners Guide to HTTP Caching
- API Documentation platforms – RAML, API Blueprint, Swagger
- Books:
- Build APIs You Won't Hate by Phil Sturgeon
- RESTful Web Services by Leonard Richardson & Sam Ruby