正解:A
RESTful constraints are described as follows:
- Client/server - clients and servers are fully separated and communicate only via the RESTful interface.
- Stateless - no client context or state is stored on the server between requests, and each client request must contain all of the information needed for the server to service the request.
- Cacheable - clients can cache responses, and servers must define the cacheability of the response.
- Layered - a client should not be able to tell whether it is connected to a server or to an intermediate that provides functionality such as security, caching, or load-balancing.
- Code on Demand (Optional) - servers can at times extend the capabilities of a client through the transfer of executable code or scripts.
- Uniform Interface - both client and server must adhere to a uniform interface that allows for the independent development of functionality.
- Resource Identification - individual resources are identified using URIs in requests.
Representations of resources are distinct from the actual resources and may be provided in formats such as HTML, XML, or JSON.