Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
REST API Fundamentals
1.
2. List of Topics
What is REST?
RESTFul Webservices
Why REST ?
HTTP methods
Characteristics
Summary
3. What is REST?
REST is an architectural style which is based on web-standards and the
HTTP protocol. REST was first described by Roy Fielding in 2000.
In a REST based architecture everything is a resource. A resource is
accessed via a common interface based on the HTTP standard
methods.
In a REST based architecture you typically have a REST server which
provides access to the resources and a REST client which accesses and
modify the REST resources.
Every resource should support the HTTP common operations.
Resources are identified by global IDs (which are typically URIs).
REST allows that resources have different representations, e.g. text,
xml, json (is a light-weight text-based open standard designed for
human-readable data. It is the most widely used format for
interchanging data on the web) etc. The rest client can ask for specific
representation via the HTTP protocol (content negotiation).
4. What is REST cont…
The REST architectural style was developed by W3C Technical
Architecture Group (TAG) in parallel with HTTP 1.1, based on the
existing design of HTTP 1.0
Its State less :
The client–server communication is further constrained by no client
context being stored on the server between requests.
Each request is independent of others
Cacheable:
As on the World Wide Web, clients can cache responses. Responses must
therefore, implicitly or explicitly, define themselves as cacheable
Well-managed caching partially or completely eliminates some client–
server interactions, further improving scalability and performance.
5. RESTful Webservices
A RESTFul webservices are based on the HTTP methods and the
concept of REST. A RESTFul webservices typically defines the base URI
for the services, the supported MIME-types (XML, Text, JSON, user-
defined,..) and the set of operations (POST, GET, PUT, DELETE) which
are supported.
Simplistically, a “RESTful architecture” includes:
Resources(things) with
Unique ids(URLs) that can come in many
Representations(text, html, json) than you operate on with
Verbs(GET, PUT, DELETE,POST)
7. HTTP methods
The PUT, GET, POST and DELETE methods are typical
used in REST based architectures.
The following gives an explanation of these operations.
GET defines a reading access of the resource without side-
effects. The resource is never changed via a GET request, e.g.
the request has no side effects (idempotent).
PUT creates a new resource, must also be idempotent.
DELETE removes the resources. The operations are
idempotent, they can get repeated without leading to
different results.
POST updates an existing resource or creates a new resource.