Chapter 2 Understanding HTTP, REST, and APIs

Design and Build Great Web APIs — by Mike Amundsen (16 / 127)

The Pragmatic Programmers
The Pragmatic Programmers

--

👈 Chapter Exercise | TOC | Understanding Web API Protocols, Practices, and Styles 👉

In the previous chapter, we explored the API-First principle and learned to use the curl utility to start making simple API calls to some of the services we’ll be using throughout this book to put together our own API. In this chapter, I’m going to step back a bit and talk about some of the technical details behind those curl calls and how the common practices and patterns used to build applications on the web can help us when we design and build our own APIs.

We’ll also spend time using another important command-line tool — Git — and a related website: http://github.com. We’ll use these together to manage all the files and folders in our API project and to track and publish changes to the source code, design documents, and test results we’ll be generating as we go through the API design and build process. I commonly design and build my APIs using lots of small tasks that build up over time into the final result. And I keep track of all those small tasks (and the changes they entail) using Git. A big advantage to doing this is that, if something goes wrong with one of my changes, it’s almost always small enough that I can just use Git to reverse my last set of changes and get the system back to a stable, working version. Small changes are great for maintaining a safe, healthy API, and Git is the…

--

--

The Pragmatic Programmers
The Pragmatic Programmers

We create timely, practical books and learning resources on classic and cutting-edge topics to help you practice your craft and accelerate your career.