...

/

Understanding Web API Protocols, Practices, and Styles

Understanding Web API Protocols, Practices, and Styles

Learn about web API protocols, practices, and styles.

In this lesson, before discussing the details of Git, let’s review the open standards and common practices that have helped make the internet, and the web in particular, a great place to build and publish APIs. For that, we’ll cover three general topics:

  • HTTP protocol
  • Common practices behind the success of the web
  • REST style for designing and building HTTP-based applications

HTTP is an open standard protocol that’s helped stabilize and power the web for about 30 years. HTTP isn’t the only open protocol used to build APIs on the internet, but it’s the most popular one to date, and we’ll use it for all the APIs.

The web itself isn’t actually a standard. It’s more of a set of common patterns and practices initially established by Tim Berners-Lee when he first started to implement early versions of HTTP and HTML in 1989. Our APIs will follow those principles too.

Finally, Roy T. Fielding’s REST style for building applications over HTTP is even less than a standard or set of common practices. REST is really a style of doing things that Fielding documented to help software architects and programmers build robust, reliable, and scalable applications and APIs. We’ll be relying on most of Fielding’s guidance as we design and implement our APIs.

The basics of HTTP

Most APIs on the web rely on a standard protocol to make sure machines can talk to each other over the internet. That protocol is the hypertext transfer protocol or HTTP. The first public version of HTTP was released in 1991, and several more versions have been documented and released in the almost 30 years since then. The HTTP protocol standard is currently managed by the Internet Engineering Task ...