Alexandre Gaigalas
Requisitos
Regras
Propriedades
Fatores Derivados de Outros Estilos
Fatores RESTful
Parte 0: Identificação de Recursos
example.com/about
maps.ex/paris
artists.ex/magritte
Parte 1: Manipulação de Recursos
por Representações
Ceci n'est pas une pipe.
Parte 2: Mensagens Auto-Descritivas
Parte 3: Hipermídia como Motor de Estado
A única regra opcional do REST
example.com/service
example.com/articles
example.com/images
example.com/people
Nível 0
Nível 1
example.com/articles
example.com/images
example.com/people
Nível 1
Nível 2
POST,PUT /articles
GET,PATCH /images
POST,GET /people
Nível 2
Nível 3
POST,PUT /articles
GET,PATCH /images
POST,GET /people
<a href="..." rel="...">
<xsl:include>
{"_links" : ... }
REST em Regras
REST em Passos
RMM Nível 3 Não é Suficiente!
Um modelo para avaliar hipermídia.
LE Link Embedding Links embutidos no recurso
LO Link Outbound Links para navegar
LT Link Templating Formulários para navegar
LN Unsafe Updates Formulários para alterar estado
LI Safe Updates Formulários para impor estado
Exemplos com HTML
LE Link Embedding <img, <iframe, <script
LO Link Outbound <a href
LT Link Templating <form method="get"
LN Unsafe Updates <form method="post"
LI Safe Updates AJAX (PUT, DELETE)
CR Control Read Escolher o media type ao ler
CU Control Update Escolher o media type ao atualizar
CM Control Methods Escolher o método do protocolo
CL Control Links Escolher as relações entre links
Exemplos em HTML/XSL
CR Control Read <xsl:include accept="text/plain"
CU Control Update <form enctype="application/...
CM Control Methods <form method="post"
CL Control Links <a rel="item"
CL
CR CU CM
LE LO LT LN LI
CL
CR CU CM
LE LO LT LN LI
CL
CR CU CM
LE LO LT LN LI
CL
CR CU CM
LE LO LT LN LI
CL
CR CU CM
LE LO LT LN LI
CL
CR CU CM
LE LO LT LN LI
CL
CR CU CM
LE LO LT LN LI
CL
CR CU CM
LE LO LT LN LI
CL
CR CU CM
LE LO LT LN LI
Workarounds for broken implementations (such as those browsers stupid enough to believe that HTML defines HTTP’s method set) should be defined separately, or at least in appendices, with an expectation that the workaround will eventually be obsolete
Roy Fielding, 2008