Cargando…

REST API design rulebook /

In today's market, where rival web services compete for attention, a well-designed REST API is a must-have feature. This concise book presents a set of API design rules, drawn primarily from best practices that stick close to the Web's REST architectural style. Along with rules for URI des...

Descripción completa

Detalles Bibliográficos
Clasificación:Libro Electrónico
Autor principal: Massé, Mark
Formato: Electrónico eBook
Idioma:Inglés
Publicado: Sebastopol, CA : O'Reilly, ©2012.
Temas:
Acceso en línea:Texto completo (Requiere registro previo con correo institucional)
Tabla de Contenidos:
  • Table of Contents; Preface; Greetings Program!; Conventions Used in This Book; Using Code Examples; Safari® Books Online; How to Contact Us; Acknowledgments; Tim Berners-Lee; Roy Fielding; Leonard Richardson; O'Reilly Media, Inc.; Technical Reviewers; Colleagues; The REST Community; Stuart Rackham; Personal; Chapter 1. Introduction; Hello World Wide Web; Web Architecture; Client-Server; Uniform Interface; Identification of resources; Manipulation of resources through representations; Self-descriptive messages; Hypermedia as the engine of application state (HATEOAS); Layered System; Cache.
  • StatelessCode-On-Demand; Web Standards; REST; REST APIs; REST API Design; Rules; WRML; Recap; Chapter 2. Identifier Design with URIs; URIs; URI Format; Rule: Forward slash separator (/) must be used to indicate a hierarchical relationship; Rule: A trailing forward slash (/) should not be included in URIs; Rule: Hyphens (
  • ) should be used to improve the readability of URIs; Rule: Underscores (_) should not be used in URIs; Rule: Lowercase letters should be preferred in URI paths; Rule: File extensions should not be included in URIs; URI Authority Design.
  • Rule: Consistent subdomain names should be used for your APIsRule: Consistent subdomain names should be used for your client developer portal; Resource Modeling; Resource Archetypes; Document; Collection; Store; Controller; URI Path Design; Rule: A singular noun should be used for document names; Rule: A plural noun should be used for collection names; Rule: A plural noun should be used for store names; Rule: A verb or verb phrase should be used for controller names; Rule: Variable path segments may be substituted with identity-based values.
  • Rule: CRUD function names should not be used in URIsURI Query Design; Rule: The query component of a URI may be used to filter collections or stores; Rule: The query component of a URI should be used to paginate collection or store results; Recap; Chapter 3. Interaction Design with HTTP; HTTP/1.1; Request Methods; Rule: GET and POST must not be used to tunnel other request methods; Rule: GET must be used to retrieve a representation of a resource; Rule: HEAD should be used to retrieve response headers; Rule: PUT must be used to both insert and update a stored resource.
  • Rule: PUT must be used to update mutable resourcesRule: POST must be used to create a new resource in a collection; Rule: POST must be used to execute controllers; Rule: DELETE must be used to remove a resource from its parent; Rule: OPTIONS should be used to retrieve metadata that describes a resource's available interactions; Response Status Codes; Rule: 200 ("OK") should be used to indicate nonspecific success; Rule: 200 ("OK") must not be used to communicate errors in the response body; Rule: 201 ("Created") must be used to indicate successful resource creation.