Perhaps the most foundational constraint, Client-Server enforces the separation of concerns in the form of a client-server architecture. This helps establish a fundamental distributed architecture, thereby supporting the independent evolution of the client-side logic and server-side logic.
The Client-Server constraint requires that a service offer one or more capabilities and listen for requests on these capabilities. A consumer invokes a capability by sending the corresponding request message, and the service either rejects the request or performs the requested task before sending a response message back to the consumer (Figure 1). Exceptions that prevent the task from proceeding are raised back to the consumer, and the consumer is responsible for taking corrective action.
Figure 1 - Client-Server introduces a clear separation between a service and its consumers.
When discussing REST, it is common to use the terms "client" and "server" to refer to the initiator and recipient of a request message, respectively. On this Website, REST is explored specifically within the context of services. As established in the Introduction to Services section, a software program issuing a request to a service assumes the role of service consumer. Therefore, from hereon, the term "client" is generally replaced with "service consumer" and for the term "server" the term "service" is used instead.