RESTperiaatteet
RESTperiaatteet, or Representational State Transfer principles, is a set of architectural constraints designed to create scalable and maintainable web services. It was introduced by Roy Fielding in his doctoral dissertation in 2000. REST is not a protocol or standard, but rather a set of guidelines for building web services that are stateless, client-server, and cacheable.
The core principles of REST include:
1. Statelessness: Each request from a client to a server must contain all the information the server
2. Client-server architecture: The client and server operate independently, allowing each to evolve separately. The client
3. Cacheability: Responses from the server must define themselves as cacheable or non-cacheable to prevent clients
4. Uniform interface: REST uses a standard set of methods (GET, POST, PUT, DELETE) to manipulate resources.
5. Layered system: A client cannot ordinarily tell whether it is connected directly to the end server
6. Code on demand (optional): Servers can extend client functionality by transferring executable code, such as
RESTful services typically use HTTP as the application protocol and JSON or XML as the data format.