The Web and the REST API
Learn about the power of the web and the style of REST.
We'll cover the following...
The power of the web
When creating our web APIs, it’s important to remember that we’re building them on top of the existing web. As mentioned earlier, what’s interesting about the web is that it’s not really a standard in the way that HTTP is a standard. There’s no definite committee-managed document that defines the web. However, the way people build on the web is pretty much the same everywhere. In this way, the web can be called a common practice or set of patterns. And being familiar with these common practices can help us get up to speed quickly on building great APIs.
The web was the brainchild of Tim Berners-Lee in 1989. He wanted to build a linked-information system based on a nonlinear text system known as hypertext. Basically, he wanted to come up with a relatively easy way for people to publish their data online and connect their publications to others online. And he wanted to do this in a way that could easily change over time without a lot of detailed coordination. When we think of the original reasons for Berners-Lee to create his World Wide Web, it sounds similar to the reasons people want to use APIs. To make this idea a reality, Berners-Lee created the initial rules for the HTTP protocol and for the hypertext markup language (HTML) message format. Not long after that, others contributed the Cascading Style Sheets (CSS) and JavaScript standards that helped launch the web browser as we know it today. This mix of simple, standalone elements (protocol, format, styles, and scripting) grew at an exponential rate, not just because they were each well-designed specifications, but also because the rules on how they are used together were so easy to adopt. We didn’t need to be computer scientists to start creating pages on the web. The power of the web comes from clear standards that everyone can agree on and an easy on-ramp for those just getting started. And that’s the way we’ll approach ...