8. HTTP REQUEST METHODS
GET POST PUT DELETE
queries the changes produces new deletes
representation the state of or replaces resources
of a resource a resource content of
existing
resources
(idempotent)
12. 1
Designer starts with
nothing (blank) and builds
2
an architecture from
familiar components.
2
Designer starts with the
system needs and
applies constraints to
elements of the system.
13. REST
2
Designer starts with the
system needs and
applies constraints to
elements of the system.
15. 1 Client-server Architecture
A server component offering services, listens for requests upon
these services. A client component desires that a service be
performed, sends a request to the server via a connector.
client server
triggering process reactionary process
16. initiates interaction by responds to the request
sending a request for a by either performing the
service to be performed service or rejecting it
client role server role
This separation allows for the two components to
evolve independently, which increases scalability.
17. 2 Stateless Communication
Each request from the client must contain all necessary
information to understand the request.
This constraint induces:
• Visibility – need to look at only one request to get the
full nature of the request
• Reliability – eases the task of recovering from failures
• Scalability – not having to store data between requests
allows the server to free resources
18. 3 Cache
Cache constraints require that the data within a response
to a request be labeled as cacheable or non-cacheable. If
a response is cacheable, a client cache is given the right to
reuse the response data for later, equivalent requests.
Cache constraints eliminate some interactions and improve
efficiency and scalability. Cache can decrease reliability
because of stale data.
19. 4 Uniform Interface
1. Identification of resources
A resource is any information that can be named. An example of a resource is
the current weather in Austin, TX. Resource identification requires the same
authority who maintains the reference to a resource to also be responsible for
preserving meaning of that resource.
2. Manipulation of resources through representations
The resources must be manipulated via representations. A client has no
access to a resource directly, it can only send and receive representations
from the server. (An example of a representation is an html page with a PNG
image of the current weather in Austin, TX.)
20. Data Element Modern Web Examples
resource the intended conceptual target of a
hypertext reference
resource identifier URL, URN
representation HTML document, JPEG image
representation metadata media type, last-modified time
resource metadata source link, alternates, vary
control data if-modified-since, cache-control
21. Connector Modern Web Examples
client libwww, libwww-perl
server libwww, Apache, API, NSAPI
cache browser cache, Akamai cache
network
resolver bind (DNS lookup library)
tunnel SOCKS, SSL after HTTP
CONNECT
22. 3. Self-descriptive messages
States that all messages must include metadata which describe
the meaning of the message.
4. Hypermedia as the engine of application state
The steps in a REST architecture must be invoked through hypermedia. More
specifically, in order for an application’s process to move a step, it must
invoke that next step from a reference inside the current representation.
23. 1
Render the data where it’s
located and send a fixed-format
image to the recipient
3
options for a
distributed
hypermedia
2
Encapsulate the data with a
rendering engine and
send both to the recipient
3
architect Send the raw data to the recipient along
with metadata that describes the data
type so that the recipient can choose their
own rendering engine
24. 5 Layered System
Layered system style allows an architecture to be composed
of hierarchical layers by constraining component behavior so
each component cannot ‘see’ beyond the immediate layer
with which they are interacting.
Layered system style helps reduce complexity and promote
independence. Layers can be used to protect new services
from legacy clients. They can also add overhead.
25. 6 Code on Demand
REST allows client functionality to be extended by
downloading and executing code in the form of scripts.
If the API is working, your should see a Response section appear at the bottom. You should see Status: 200 OK, a Headers: field, and a Data: field containing something like this:<html><body>Lead has been successfully added to HubSpot<br/>submissionGuid=4dd4e3b251914c92aeb737d815b307c2</body></html>