REST API & SOAP - ryantc94/Knights-of-Arthur GitHub Wiki
REST API
http://www.restapitutorial.com/lessons/whatisrest.html
- Quick Note: My understanding of REST API is just a middleman for processing HTTP Methods, Database Manipulation/Resource Manipulation, and HTTP Responses.
6 Constraints
- Uniform Interface: (example [doesn't have to be http]: HTTP Request (representation), URI, HTTP Response)
- Stateless: Server contains no client state (each request contains enough info for server to process info), representation contains all the state
- Cacheable: Representations are cacheable (implicitly, explicitly, negotiated)
- Client-Server: a disconnected system (client won't have direct connection to database/resources), Uniform Interface is the link between the two
- Layered System: Restful architecture could have multiple layers of software, client doesn't know if resource comes back from cache or database. Client only knows API and response representation.
- Code on Demand (optional): From a restful service stand point, the server can transfer logic to the client. Such as executable JS snippets.
- Compliance of these 6 constraints allows: scalability, simplicity, modifiability, visibility, portability, and reliability