RESTfulll web services
-
Upload
juan-sandoval -
Category
Software
-
view
45 -
download
0
Transcript of RESTfulll web services
RESTful Web ServicesJuan Sandoval@juanitodread
AgendaIntroduction to REST
IntroductionPrinciples
Design RESTful services
● Introduction to RESTREST is a set of architectural principles that answer the following questions:
Why is the web so prevalent and ubiquitous?
What makes the web scale?How can I apply the architecture of the Web to my own applications?
● PrinciplesREST: REpresentational State Transfer
Addressable resourcesA uniform, constrained interfaceRepresentation-orientedCommunicate statelesslyHypermedia As The Engine Of Application State
(HATEOAS)
AddressabilityIs the idea that every object and resource in your system is reachable through a unique identifier.In REST is managed through the use of URIs.Each HTTP request must contain the URI of the object you are requesting information
scheme://host:port/path?query#fragment
Constrained InterfaceYou must use the finite set of operations of HTTP. Each method has a specific purpose and meaning.
GetPutDeletePostHeadOptions
Representation-OrientedThe representation is the message body of your request or response. An HTTP message body may be in any format the server and client want to exchange.
HTTP content negotiation is a very powerful tool when writing web services.
Communicate StatelesslyIs the idea that there is no client session data stored on the server. The server only records and manages state of the resource it exposes. If there needs to be session-specific data, it should be held and maintained by the client and transferred to the server with each request as needed.
HATEOASThe idea is use Hypermedia As The Engine Of Application State. Hypermedia is a document-centric approach with the added support for embedding links to other services and information within that document format.
HATEOAS enforces with each request returned from a server it tells you what new interactions you can do next, as well as where to go to transition the state of your applications.
Design RESTful ServicesDefine the object model.Define a distributed interface through HTTP.Define a set of URIs that represent the entry points
into our system.Define the data format that we will use to exchange
information between services and clients.Define which HTTP methods are allowed by each
exposed URI and what those methods do.
Code of the course: e-commerce-rest-api
Thank you!