SlideShare ist ein Scribd-Unternehmen logo
1 von 6
Downloaden Sie, um offline zu lesen
Representational State Transfer (REST)

Representational State Transfer (REST) is a style of software
architecture for distributed systems such as the World Wide Web. REST has emerged as a
predominant Web service design model.

Key goals
Key goals of REST include:

   Scalability of component interactions
   Generality of interfaces
   Independent deployment of components
   Intermediary components to reduce latency, enforce security and encapsulate legacy
    systems

REST has been applied to describe the desired web architecture, to help identify existing
problems, to compare alternative solutions, and to ensure that protocol extensions would not
violate the core constraints that make the Web successful.




Constraints
The REST architectural style describes the following six constraints applied to the architecture,
while leaving the implementation of the individual components free to design:

Client–server

       A uniform interface separates clients from servers. This separation of concerns means
       that, for example, clients are not concerned with data storage, which remains internal to
       each server, so that the portability of client code is improved. Servers are not concerned
       with the user interface or user state, so that servers can be simpler and more scalable.
       Servers and clients may also be replaced and developed independently, as long as the
       interface between them is not altered.

Stateless

       The client–server communication is further constrained by no client context being stored
       on the server between requests. Each request from any client contains all of the
       information necessary to service the request, and any session state is held in the client.
Cacheable

       As on the World Wide Web, clients can cache responses. Responses must therefore,
       implicitly or explicitly, define themselves as cacheable, or not, to prevent clients reusing
       stale or inappropriate data in response to further requests. Well-managed caching
partially or completely eliminates some client–server interactions, further improving
        scalability and performance.
Layered system

        A client cannot ordinarily tell whether it is connected directly to the end server, or to an
        intermediary along the way. Intermediary servers may improve system scalability by
        enabling load-balancing and by providing shared caches. They may also enforce security
        policies.
Code on demand (optional)

        Servers are able temporarily to extend or customize the functionality of a client by the
        transfer of executable code. Examples of this may include compiled components such
        as Java applets and client-side scripts such as JavaScript.
Uniform interface

        The uniform interface between clients and servers, discussed below, simplifies and
        decouples the architecture, which enables each part to evolve independently. The four
        guiding principles of this interface are detailed below.

The only optional constraint of REST architecture is code on demand. If a service violates any
other constraint, it cannot strictly be considered RESTful.



Central principle
An important concept in REST is the existence of resources (sources of specific information),
each of which is referenced with a global identifier (e.g., a URI in HTTP). In order to manipulate
these resources, components of the network (user agents and origin servers) communicate via a
standardized interface (e.g., HTTP) and exchange representations of these resources (the actual
documents conveying the information). For example, a resource that represents a circle (as a
logical object) may accept and return a representation that specifies a center point and radius,
formatted in SVG, but may also accept and return a representation that specifies any three
distinct points along the curve (since this also uniquely identifies a circle) as a comma-separated
list.

Any number of connectors (e.g., clients, servers, caches, tunnels, etc.) can mediate the request,
but each does so without "seeing past" its own request (referred to as "layering," another
constraint of REST and a common principle in many other parts of information and networking
architecture). Thus, an application can interact with a resource by knowing two things: the
identifier of the resource and the action required—it does not need to know whether there are
caches, proxies, gateways, firewalls, tunnels, or anything else between it and the server actually
holding the information. The application does, however, need to understand the format of the
information (representation) returned, which is typically an HTML, XML or JSON document of
some kind, although it may be an image, plain text, or any other content.
RESTful web services
A RESTful web service (also called a RESTful web API) is a web service implemented using HTTP
and the principles of REST. It is a collection of resources, with four defined aspects: the base URI
for the web service, such as http://example.com/resources/


   The Internet media type of the data supported by the web service. This is often XML but can
    be any other valid Internet media type providing that it is a valid hypertext standard.
   The set of operations supported by the web service using HTTP methods (e.g., GET, PUT,
    POST, or DELETE).

   The API must be hypertext driven.

   The following table shows how the HTTP methods are typically used to implement a web
    service.


                             RESTful Web Service HTTP methods



          Resource                       GET                 PUT                 POST           DELETE



                                                                           Create a new
                                                                           entry in the
                                                                           collection. The
                                 List the URIs and
                                                       Replace the         new entry's
    Collection URI, such         perhaps other                                                 Delete
                                                       entire collection URL is
ashttp://example.com/re details of the                                                         the entire
                                                       with another        assigned
          sources/               collection's                                                  collection.
                                                       collection.         automatically
                                 members.
                                                                           and is usually
                                                                           returned by
                                                                           the operation.



                                                                           Not generally
                                 Retrieve a
                                                                           used. Treat
                                 representation of     Replace the                             Delete
                                                                           the addressed
                                 the addressed         addressed                               the
     Element URI, such                                                     member as a
                                 member of the         member of the                           addressed
ashttp://example.com/re                                                    collection in its
                                 collection,           collection, or if                       member
      sources/item17                                                       own right
                                 expressed in an       it doesn't exist,                       of the
                                                                           and create a
                                 appropriate Internet create it.                               collection.
                                                                           new entry in
                                 media type.
                                                                           it.
The PUT and DELETE methods are idempotent methods. The GET method is a safe method (or
nullipotent), meaning that calling it produces no side-effects.

Unlike SOAP-based web services, there is no "official" standard for RESTful web services. This is
because REST is an architectural style, unlike SOAP, which is a protocol. Even though REST is not
a standard, a RESTful implementation such as the Web can use standards like HTTP, URI, XML,
etc.



Why is it called Representational State Transfer?
The Web is comprised of resources. A resource is any item of interest. For example, the
Boeing Aircraft Corp may define a 747 resource. Clients may access that resource with this
URL:

http://www.boeing.com/aircraft/747
A representation of the resource is returned (e.g., Boeing747.html). The representation
places the client application in a state. The result of the client traversing a hyperlink in
Boeing747.html is another resource is accessed. The new representation places the client
application into yet another state. Thus, the client application changes (transfers) state
with each resource representation --> Representational State Transfer!

Here is Roy Fielding's explanation of the meaning of Representational State Transfer:

"Representational State Transfer is intended to evoke an image of how a well-designed Web
application behaves: a network of web pages (a virtual state-machine), where the user
progresses through an application by selecting links (state transitions), resulting in the next
page (representing the next state of the application) being transferred to the user and
rendered for their use."



REST - An Architectural Style, Not a Standard
REST is not a standard. You will not see the W3C putting out a REST specification. You will
not see IBM or Microsoft or Sun selling a REST developer's toolkit. Why? Because REST is
just an architectural style. You can't bottle up that style. You can only understand it, and
design your Web services in that style. (Analogous to the client-server architectural style.
There is no client-server standard.)

While REST is not a standard, it does use standards:

       HTTP
       URL
       XML/HTML/GIF/JPEG/etc (Resource Representations)
       text/xml, text/html, image/gif, image/jpeg, etc (MIME Types)
REST Web Services Characteristics
Here are the characteristics of REST:

       Client-Server: a pull-based interaction style: consuming components pull
       representations.
       Stateless: each request from client to server must contain all the information
       necessary to understand the request, and cannot take advantage of any stored
       context on the server.
       Cache: to improve network efficiency responses must be capable of being labeled as
       cacheable or non-cacheable.
       Uniform interface: all resources are accessed with a generic interface (e.g., HTTP
       GET, POST, PUT, DELETE).
       Named resources - the system is comprised of resources which are named using a
       URL.
       Interconnected resource representations - the representations of the resources are
       interconnected using URLs, thereby enabling a client to progress from one state to
       another.
       Layered components - intermediaries, such as proxy servers, cache servers,
       gateways, etc, can be inserted between clients and resources to support
       performance, security, etc.

Principles of REST Web Service Design
1. The key to creating Web Services in a REST network (i.e., the Web) is to identify all of
the conceptual entities that you wish to expose as services. Above we saw some examples
of resources: parts list, detailed part data, purchase order.

2. Create a URL to each resource. The resources should be nouns, not verbs. For example,
do not use this:

http://www.parts-depot.com/parts/getPart?id=00345
Note the verb, getPart. Instead, use a noun:

http://www.parts-depot.com/parts/00345
3. Categorize your resources according to whether clients can just receive a representation
of the resource, or whether clients can modify (add to) the resource. For the former, make
those resources accessible using an HTTP GET. For the later, make those resources
accessible using HTTP POST, PUT, and/or DELETE.

4. All resources accessible via HTTP GET should be side-effect free. That is, the resource
should just return a representation of the resource. Invoking the resource should not result
in modifying the resource.

5. No man/woman is an island. Likewise, no representation should be an island. In other
words, put hyperlinks within resource representations to enable clients to drill down for
more information, and/or to obtain related information.

6. Design to reveal data gradually. Don't reveal everything in a single response document.
Provide hyperlinks to obtain more details.
7. Specify the format of response data using a schema (DTD, W3C Schema, RelaxNG, or
Schematron). For those services that require a POST or PUT to it, also provide a schema to
specify the format of the response.

8. Describe how your services are to be invoked using either a WSDL document, or simply
an HTML document.

Summary
This article described REST as an architectural style. In fact, it's the architectural style of
the Web. REST describes what makes the Web work well. Adhering to the REST principles
will make your services work well in the context of the Web.

References
   1. http://www.ics.uci.edu/~fielding/pubs/dissertation/top.htm
   2. http://www.wikipedia.org/

Weitere ähnliche Inhalte

Was ist angesagt?

Representational State Transfer (REST)
Representational State Transfer (REST)Representational State Transfer (REST)
Representational State Transfer (REST)David Krmpotic
 
RESTful Architecture
RESTful ArchitectureRESTful Architecture
RESTful ArchitectureKabir Baidya
 
ReST (Representational State Transfer) Explained
ReST (Representational State Transfer) ExplainedReST (Representational State Transfer) Explained
ReST (Representational State Transfer) ExplainedDhananjay Nene
 
Overview of RESTful web services
Overview of RESTful web servicesOverview of RESTful web services
Overview of RESTful web servicesnbuddharaju
 
REST and RESTful Web Services
REST and RESTful Web ServicesREST and RESTful Web Services
REST and RESTful Web ServicesKasun Madusanke
 
Restful web services by Sreeni Inturi
Restful web services by Sreeni InturiRestful web services by Sreeni Inturi
Restful web services by Sreeni InturiSreeni I
 
Restful webservice
Restful webserviceRestful webservice
Restful webserviceDong Ngoc
 
Rest & RESTful WebServices
Rest & RESTful WebServicesRest & RESTful WebServices
Rest & RESTful WebServicesPrateek Tandon
 
Rest presentation
Rest  presentationRest  presentation
Rest presentationsrividhyau
 
Rest and the hypermedia constraint
Rest and the hypermedia constraintRest and the hypermedia constraint
Rest and the hypermedia constraintInviqa
 
6 Months Industrial Training in Spring Framework
6 Months Industrial Training in Spring Framework6 Months Industrial Training in Spring Framework
6 Months Industrial Training in Spring FrameworkArcadian Learning
 
RESTful services
RESTful servicesRESTful services
RESTful servicesgouthamrv
 
Rest API Automation with REST Assured
Rest API Automation with REST AssuredRest API Automation with REST Assured
Rest API Automation with REST AssuredTO THE NEW Pvt. Ltd.
 

Was ist angesagt? (20)

Representational State Transfer (REST)
Representational State Transfer (REST)Representational State Transfer (REST)
Representational State Transfer (REST)
 
RESTful Architecture
RESTful ArchitectureRESTful Architecture
RESTful Architecture
 
ReST (Representational State Transfer) Explained
ReST (Representational State Transfer) ExplainedReST (Representational State Transfer) Explained
ReST (Representational State Transfer) Explained
 
Overview of RESTful web services
Overview of RESTful web servicesOverview of RESTful web services
Overview of RESTful web services
 
REST & RESTful Web Services
REST & RESTful Web ServicesREST & RESTful Web Services
REST & RESTful Web Services
 
JSON and REST
JSON and RESTJSON and REST
JSON and REST
 
Rest web services
Rest web servicesRest web services
Rest web services
 
REST and RESTful Web Services
REST and RESTful Web ServicesREST and RESTful Web Services
REST and RESTful Web Services
 
ReSTful API Final
ReSTful API FinalReSTful API Final
ReSTful API Final
 
RESTful Web Services
RESTful Web ServicesRESTful Web Services
RESTful Web Services
 
Restful web services by Sreeni Inturi
Restful web services by Sreeni InturiRestful web services by Sreeni Inturi
Restful web services by Sreeni Inturi
 
Restful webservice
Restful webserviceRestful webservice
Restful webservice
 
Rest & RESTful WebServices
Rest & RESTful WebServicesRest & RESTful WebServices
Rest & RESTful WebServices
 
Rest presentation
Rest  presentationRest  presentation
Rest presentation
 
Rest and the hypermedia constraint
Rest and the hypermedia constraintRest and the hypermedia constraint
Rest and the hypermedia constraint
 
Rest http basics
Rest http basicsRest http basics
Rest http basics
 
Rest Webservice
Rest WebserviceRest Webservice
Rest Webservice
 
6 Months Industrial Training in Spring Framework
6 Months Industrial Training in Spring Framework6 Months Industrial Training in Spring Framework
6 Months Industrial Training in Spring Framework
 
RESTful services
RESTful servicesRESTful services
RESTful services
 
Rest API Automation with REST Assured
Rest API Automation with REST AssuredRest API Automation with REST Assured
Rest API Automation with REST Assured
 

Andere mochten auch

How to create a jQuery Modal Window
How to create a jQuery Modal WindowHow to create a jQuery Modal Window
How to create a jQuery Modal WindowLikno Software
 
Purchasing power parity a unit root, cointegration and var analysis in emergi...
Purchasing power parity a unit root, cointegration and var analysis in emergi...Purchasing power parity a unit root, cointegration and var analysis in emergi...
Purchasing power parity a unit root, cointegration and var analysis in emergi...Giwrgos Loukopoulos
 
A Hypervisor IPS based on Hardware Assisted Virtualization Technology
A Hypervisor IPS based on Hardware Assisted Virtualization TechnologyA Hypervisor IPS based on Hardware Assisted Virtualization Technology
A Hypervisor IPS based on Hardware Assisted Virtualization TechnologyFFRI, Inc.
 
Connect.Tech- Enhancing Your Workflow With Xcode Source Editor Extensions
Connect.Tech- Enhancing Your Workflow With Xcode Source Editor ExtensionsConnect.Tech- Enhancing Your Workflow With Xcode Source Editor Extensions
Connect.Tech- Enhancing Your Workflow With Xcode Source Editor Extensionsstable|kernel
 
EQUITY MARKET INTEGRATION IN SELECTED MARKETS: EVIDENCE FROM UNIT ROOT AND CO...
EQUITY MARKET INTEGRATION IN SELECTED MARKETS: EVIDENCE FROM UNIT ROOT AND CO...EQUITY MARKET INTEGRATION IN SELECTED MARKETS: EVIDENCE FROM UNIT ROOT AND CO...
EQUITY MARKET INTEGRATION IN SELECTED MARKETS: EVIDENCE FROM UNIT ROOT AND CO...akjsk10
 
Creational pattern
Creational patternCreational pattern
Creational patternHimanshu
 
1.Buffer Overflows
1.Buffer Overflows1.Buffer Overflows
1.Buffer Overflowsphanleson
 
Intrinsic Encounter - Cognitive Load Theory
Intrinsic Encounter - Cognitive Load TheoryIntrinsic Encounter - Cognitive Load Theory
Intrinsic Encounter - Cognitive Load TheoryDylan Grace
 
Web design trends for 2010
Web design trends for 2010Web design trends for 2010
Web design trends for 2010Tijs Vrolix
 
Minimize Cognitive Load + Maximize Conversions : 10 Tips
Minimize Cognitive Load + Maximize Conversions : 10 TipsMinimize Cognitive Load + Maximize Conversions : 10 Tips
Minimize Cognitive Load + Maximize Conversions : 10 TipsLucid Smart Pill
 
Buffer overflow and other software vulnerabilities: theory and practice of pr...
Buffer overflow and other software vulnerabilities: theory and practice of pr...Buffer overflow and other software vulnerabilities: theory and practice of pr...
Buffer overflow and other software vulnerabilities: theory and practice of pr...Roman Oliynykov
 
Hardware support for efficient virtualization
Hardware support for efficient virtualizationHardware support for efficient virtualization
Hardware support for efficient virtualizationLennox Wu
 
Xcode, Basics and Beyond
Xcode, Basics and BeyondXcode, Basics and Beyond
Xcode, Basics and Beyondrsebbe
 
Load-testing 101 for Startups with Artillery.io
Load-testing 101 for Startups with Artillery.ioLoad-testing 101 for Startups with Artillery.io
Load-testing 101 for Startups with Artillery.ioHassy Veldstra
 
How to Run a 1,000,000 VU Load Test using Apache JMeter and BlazeMeter
How to Run a 1,000,000 VU Load Test using Apache JMeter and BlazeMeterHow to Run a 1,000,000 VU Load Test using Apache JMeter and BlazeMeter
How to Run a 1,000,000 VU Load Test using Apache JMeter and BlazeMeterAlon Girmonsky
 

Andere mochten auch (20)

M2M communications
M2M communicationsM2M communications
M2M communications
 
Lampiran unit root test
Lampiran unit root testLampiran unit root test
Lampiran unit root test
 
How to create a jQuery Modal Window
How to create a jQuery Modal WindowHow to create a jQuery Modal Window
How to create a jQuery Modal Window
 
Purchasing power parity a unit root, cointegration and var analysis in emergi...
Purchasing power parity a unit root, cointegration and var analysis in emergi...Purchasing power parity a unit root, cointegration and var analysis in emergi...
Purchasing power parity a unit root, cointegration and var analysis in emergi...
 
A Hypervisor IPS based on Hardware Assisted Virtualization Technology
A Hypervisor IPS based on Hardware Assisted Virtualization TechnologyA Hypervisor IPS based on Hardware Assisted Virtualization Technology
A Hypervisor IPS based on Hardware Assisted Virtualization Technology
 
Design patterns
Design patternsDesign patterns
Design patterns
 
Connect.Tech- Enhancing Your Workflow With Xcode Source Editor Extensions
Connect.Tech- Enhancing Your Workflow With Xcode Source Editor ExtensionsConnect.Tech- Enhancing Your Workflow With Xcode Source Editor Extensions
Connect.Tech- Enhancing Your Workflow With Xcode Source Editor Extensions
 
EQUITY MARKET INTEGRATION IN SELECTED MARKETS: EVIDENCE FROM UNIT ROOT AND CO...
EQUITY MARKET INTEGRATION IN SELECTED MARKETS: EVIDENCE FROM UNIT ROOT AND CO...EQUITY MARKET INTEGRATION IN SELECTED MARKETS: EVIDENCE FROM UNIT ROOT AND CO...
EQUITY MARKET INTEGRATION IN SELECTED MARKETS: EVIDENCE FROM UNIT ROOT AND CO...
 
Creational pattern
Creational patternCreational pattern
Creational pattern
 
1.Buffer Overflows
1.Buffer Overflows1.Buffer Overflows
1.Buffer Overflows
 
Intrinsic Encounter - Cognitive Load Theory
Intrinsic Encounter - Cognitive Load TheoryIntrinsic Encounter - Cognitive Load Theory
Intrinsic Encounter - Cognitive Load Theory
 
Web design trends for 2010
Web design trends for 2010Web design trends for 2010
Web design trends for 2010
 
Minimize Cognitive Load + Maximize Conversions : 10 Tips
Minimize Cognitive Load + Maximize Conversions : 10 TipsMinimize Cognitive Load + Maximize Conversions : 10 Tips
Minimize Cognitive Load + Maximize Conversions : 10 Tips
 
Buffer overflow and other software vulnerabilities: theory and practice of pr...
Buffer overflow and other software vulnerabilities: theory and practice of pr...Buffer overflow and other software vulnerabilities: theory and practice of pr...
Buffer overflow and other software vulnerabilities: theory and practice of pr...
 
Lecture 13
Lecture 13Lecture 13
Lecture 13
 
Buffer overflow
Buffer overflowBuffer overflow
Buffer overflow
 
Hardware support for efficient virtualization
Hardware support for efficient virtualizationHardware support for efficient virtualization
Hardware support for efficient virtualization
 
Xcode, Basics and Beyond
Xcode, Basics and BeyondXcode, Basics and Beyond
Xcode, Basics and Beyond
 
Load-testing 101 for Startups with Artillery.io
Load-testing 101 for Startups with Artillery.ioLoad-testing 101 for Startups with Artillery.io
Load-testing 101 for Startups with Artillery.io
 
How to Run a 1,000,000 VU Load Test using Apache JMeter and BlazeMeter
How to Run a 1,000,000 VU Load Test using Apache JMeter and BlazeMeterHow to Run a 1,000,000 VU Load Test using Apache JMeter and BlazeMeter
How to Run a 1,000,000 VU Load Test using Apache JMeter and BlazeMeter
 

Ähnlich wie Representational State Transfer (REST)

Ähnlich wie Representational State Transfer (REST) (20)

Webcore Twitter Vanity Widget Demo
Webcore Twitter Vanity Widget DemoWebcore Twitter Vanity Widget Demo
Webcore Twitter Vanity Widget Demo
 
Concert spring 2011_presentation_1
Concert spring 2011_presentation_1Concert spring 2011_presentation_1
Concert spring 2011_presentation_1
 
RESTful Web Services
RESTful Web ServicesRESTful Web Services
RESTful Web Services
 
[2015/2016] The REST architectural style
[2015/2016] The REST architectural style[2015/2016] The REST architectural style
[2015/2016] The REST architectural style
 
SCWCD : The servlet container : CHAP : 4
SCWCD : The servlet container : CHAP : 4SCWCD : The servlet container : CHAP : 4
SCWCD : The servlet container : CHAP : 4
 
Rest and Sling Resolution
Rest and Sling ResolutionRest and Sling Resolution
Rest and Sling Resolution
 
JAX-RS 2.0 and OData
JAX-RS 2.0 and ODataJAX-RS 2.0 and OData
JAX-RS 2.0 and OData
 
Rest in Rails
Rest in RailsRest in Rails
Rest in Rails
 
Servlet
ServletServlet
Servlet
 
ROA.ppt
ROA.pptROA.ppt
ROA.ppt
 
Java J2EE Interview Questions Part 2
Java J2EE Interview Questions Part 2Java J2EE Interview Questions Part 2
Java J2EE Interview Questions Part 2
 
Java J2EE Interview Question Part 2
Java J2EE Interview Question Part 2Java J2EE Interview Question Part 2
Java J2EE Interview Question Part 2
 
Lecture 12
Lecture 12Lecture 12
Lecture 12
 
Standards of rest api
Standards of rest apiStandards of rest api
Standards of rest api
 
Unit 2
Unit 2Unit 2
Unit 2
 
Spring from a to Z
Spring from  a to ZSpring from  a to Z
Spring from a to Z
 
Web Tech Java Servlet Update1
Web Tech   Java Servlet Update1Web Tech   Java Servlet Update1
Web Tech Java Servlet Update1
 
Interoperability in Digital Libraries
Interoperability in Digital LibrariesInteroperability in Digital Libraries
Interoperability in Digital Libraries
 
Rails interview questions
Rails interview questionsRails interview questions
Rails interview questions
 
Poli 2.0 - APIs
Poli 2.0 - APIsPoli 2.0 - APIs
Poli 2.0 - APIs
 

Kürzlich hochgeladen

Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piececharlottematthew16
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostZilliz
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfPrecisely
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 

Kürzlich hochgeladen (20)

Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piece
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 

Representational State Transfer (REST)

  • 1. Representational State Transfer (REST) Representational State Transfer (REST) is a style of software architecture for distributed systems such as the World Wide Web. REST has emerged as a predominant Web service design model. Key goals Key goals of REST include:  Scalability of component interactions  Generality of interfaces  Independent deployment of components  Intermediary components to reduce latency, enforce security and encapsulate legacy systems REST has been applied to describe the desired web architecture, to help identify existing problems, to compare alternative solutions, and to ensure that protocol extensions would not violate the core constraints that make the Web successful. Constraints The REST architectural style describes the following six constraints applied to the architecture, while leaving the implementation of the individual components free to design: Client–server A uniform interface separates clients from servers. This separation of concerns means that, for example, clients are not concerned with data storage, which remains internal to each server, so that the portability of client code is improved. Servers are not concerned with the user interface or user state, so that servers can be simpler and more scalable. Servers and clients may also be replaced and developed independently, as long as the interface between them is not altered. Stateless The client–server communication is further constrained by no client context being stored on the server between requests. Each request from any client contains all of the information necessary to service the request, and any session state is held in the client. Cacheable As on the World Wide Web, clients can cache responses. Responses must therefore, implicitly or explicitly, define themselves as cacheable, or not, to prevent clients reusing stale or inappropriate data in response to further requests. Well-managed caching
  • 2. partially or completely eliminates some client–server interactions, further improving scalability and performance. Layered system A client cannot ordinarily tell whether it is connected directly to the end server, or to an intermediary along the way. Intermediary servers may improve system scalability by enabling load-balancing and by providing shared caches. They may also enforce security policies. Code on demand (optional) Servers are able temporarily to extend or customize the functionality of a client by the transfer of executable code. Examples of this may include compiled components such as Java applets and client-side scripts such as JavaScript. Uniform interface The uniform interface between clients and servers, discussed below, simplifies and decouples the architecture, which enables each part to evolve independently. The four guiding principles of this interface are detailed below. The only optional constraint of REST architecture is code on demand. If a service violates any other constraint, it cannot strictly be considered RESTful. Central principle An important concept in REST is the existence of resources (sources of specific information), each of which is referenced with a global identifier (e.g., a URI in HTTP). In order to manipulate these resources, components of the network (user agents and origin servers) communicate via a standardized interface (e.g., HTTP) and exchange representations of these resources (the actual documents conveying the information). For example, a resource that represents a circle (as a logical object) may accept and return a representation that specifies a center point and radius, formatted in SVG, but may also accept and return a representation that specifies any three distinct points along the curve (since this also uniquely identifies a circle) as a comma-separated list. Any number of connectors (e.g., clients, servers, caches, tunnels, etc.) can mediate the request, but each does so without "seeing past" its own request (referred to as "layering," another constraint of REST and a common principle in many other parts of information and networking architecture). Thus, an application can interact with a resource by knowing two things: the identifier of the resource and the action required—it does not need to know whether there are caches, proxies, gateways, firewalls, tunnels, or anything else between it and the server actually holding the information. The application does, however, need to understand the format of the information (representation) returned, which is typically an HTML, XML or JSON document of some kind, although it may be an image, plain text, or any other content.
  • 3. RESTful web services A RESTful web service (also called a RESTful web API) is a web service implemented using HTTP and the principles of REST. It is a collection of resources, with four defined aspects: the base URI for the web service, such as http://example.com/resources/  The Internet media type of the data supported by the web service. This is often XML but can be any other valid Internet media type providing that it is a valid hypertext standard.  The set of operations supported by the web service using HTTP methods (e.g., GET, PUT, POST, or DELETE).  The API must be hypertext driven.  The following table shows how the HTTP methods are typically used to implement a web service. RESTful Web Service HTTP methods Resource GET PUT POST DELETE Create a new entry in the collection. The List the URIs and Replace the new entry's Collection URI, such perhaps other Delete entire collection URL is ashttp://example.com/re details of the the entire with another assigned sources/ collection's collection. collection. automatically members. and is usually returned by the operation. Not generally Retrieve a used. Treat representation of Replace the Delete the addressed the addressed addressed the Element URI, such member as a member of the member of the addressed ashttp://example.com/re collection in its collection, collection, or if member sources/item17 own right expressed in an it doesn't exist, of the and create a appropriate Internet create it. collection. new entry in media type. it.
  • 4. The PUT and DELETE methods are idempotent methods. The GET method is a safe method (or nullipotent), meaning that calling it produces no side-effects. Unlike SOAP-based web services, there is no "official" standard for RESTful web services. This is because REST is an architectural style, unlike SOAP, which is a protocol. Even though REST is not a standard, a RESTful implementation such as the Web can use standards like HTTP, URI, XML, etc. Why is it called Representational State Transfer? The Web is comprised of resources. A resource is any item of interest. For example, the Boeing Aircraft Corp may define a 747 resource. Clients may access that resource with this URL: http://www.boeing.com/aircraft/747 A representation of the resource is returned (e.g., Boeing747.html). The representation places the client application in a state. The result of the client traversing a hyperlink in Boeing747.html is another resource is accessed. The new representation places the client application into yet another state. Thus, the client application changes (transfers) state with each resource representation --> Representational State Transfer! Here is Roy Fielding's explanation of the meaning of Representational State Transfer: "Representational State Transfer is intended to evoke an image of how a well-designed Web application behaves: a network of web pages (a virtual state-machine), where the user progresses through an application by selecting links (state transitions), resulting in the next page (representing the next state of the application) being transferred to the user and rendered for their use." REST - An Architectural Style, Not a Standard REST is not a standard. You will not see the W3C putting out a REST specification. You will not see IBM or Microsoft or Sun selling a REST developer's toolkit. Why? Because REST is just an architectural style. You can't bottle up that style. You can only understand it, and design your Web services in that style. (Analogous to the client-server architectural style. There is no client-server standard.) While REST is not a standard, it does use standards: HTTP URL XML/HTML/GIF/JPEG/etc (Resource Representations) text/xml, text/html, image/gif, image/jpeg, etc (MIME Types)
  • 5. REST Web Services Characteristics Here are the characteristics of REST: Client-Server: a pull-based interaction style: consuming components pull representations. Stateless: each request from client to server must contain all the information necessary to understand the request, and cannot take advantage of any stored context on the server. Cache: to improve network efficiency responses must be capable of being labeled as cacheable or non-cacheable. Uniform interface: all resources are accessed with a generic interface (e.g., HTTP GET, POST, PUT, DELETE). Named resources - the system is comprised of resources which are named using a URL. Interconnected resource representations - the representations of the resources are interconnected using URLs, thereby enabling a client to progress from one state to another. Layered components - intermediaries, such as proxy servers, cache servers, gateways, etc, can be inserted between clients and resources to support performance, security, etc. Principles of REST Web Service Design 1. The key to creating Web Services in a REST network (i.e., the Web) is to identify all of the conceptual entities that you wish to expose as services. Above we saw some examples of resources: parts list, detailed part data, purchase order. 2. Create a URL to each resource. The resources should be nouns, not verbs. For example, do not use this: http://www.parts-depot.com/parts/getPart?id=00345 Note the verb, getPart. Instead, use a noun: http://www.parts-depot.com/parts/00345 3. Categorize your resources according to whether clients can just receive a representation of the resource, or whether clients can modify (add to) the resource. For the former, make those resources accessible using an HTTP GET. For the later, make those resources accessible using HTTP POST, PUT, and/or DELETE. 4. All resources accessible via HTTP GET should be side-effect free. That is, the resource should just return a representation of the resource. Invoking the resource should not result in modifying the resource. 5. No man/woman is an island. Likewise, no representation should be an island. In other words, put hyperlinks within resource representations to enable clients to drill down for more information, and/or to obtain related information. 6. Design to reveal data gradually. Don't reveal everything in a single response document. Provide hyperlinks to obtain more details.
  • 6. 7. Specify the format of response data using a schema (DTD, W3C Schema, RelaxNG, or Schematron). For those services that require a POST or PUT to it, also provide a schema to specify the format of the response. 8. Describe how your services are to be invoked using either a WSDL document, or simply an HTML document. Summary This article described REST as an architectural style. In fact, it's the architectural style of the Web. REST describes what makes the Web work well. Adhering to the REST principles will make your services work well in the context of the Web. References 1. http://www.ics.uci.edu/~fielding/pubs/dissertation/top.htm 2. http://www.wikipedia.org/