Web Requests and Web Services
Representational State Transfer (REST) and Simple Object Access Protocol (SOAP) are often used as labels to refer to two different approaches to implementing a web-based Application Programming Interface (API).
This chapter explores the client-side of this process, acting as the consumer of a web service rather than the author.
REST is extremely popular nowadays, and most web services seem to use this approach. From the developer’s perspective, a REST-based service can be created very quickly, and a great deal can be done to automatically generate clients for such services. REST is stateless, meaning that each request is independent from other requests.
SOAP services are quite difficult to find, especially services that can be demonstrated. SOAP APIs are not stateless; the contract between the client and server is stricter, which can make using the services more complicated.
The growth of cloud-based services in recent years has...