What Is REST?
Roy Fielding coined the acronym REST in his PhD dissertation. Chapter 5 of Fielding’s dissertation lays out the guiding principles for what have come to be known as REST-style or RESTful web services. Fielding has an impressive résumé. He is, among other things, a principal author of the HTTP 1.1 specification and a cofounder of the Apache Software Foundation.
REST and SOAP are quite different. SOAP is a messaging protocol in which the messages
are XML documents, whereas REST is a style of software architecture for distributed
hypermedia systems, or systems in which text, graphics, audio, and
other media are stored across a network and interconnected through
hyperlinks. The World Wide Web is the obvious example of such a system. As
the focus here is on web services, the World Wide Web is the
distributed hypermedia system of interest. In the Web, HTTP is both a
transport protocol and a messaging system because HTTP requests and
responses are messages. The payloads of HTTP messages can be typed using
the MIME (Multipurpose Internet Mail Extension) type system. MIME has
types such as text/html, application/octet-stream, and audio/mpeg3.
HTTP also provides response status codes to inform
the requester about whether a request succeeded and, if not, why. Table 1-1
lists some common status codes.
Table 1-1. Sample HTTP status codes and their meanings
| Status code | In English | Meaning |
|---|---|---|
200 | OK | Request OK |
303 | See Other | Redirect |
400 | Bad Request | Request malformed |
401 | Unauthorized | Authentication error ... |
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access