SlideShare una empresa de Scribd logo
1 de 31
HTTP
The protocol that allows for sending
docs back and forth on the web.
client role   server role
client role    server role



 initiates       responds
 interaction
header

body
includes metadata and
         HTTP methods



header

body




         includes data you want to transfer
         (text, pics, HTML, XML)
The response specifies the content type of the body




                          in the Content Type field
                          (e.g. text/html or application/json)
HTTP REQUEST METHODS
GET   POST   PUT   DELETE
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)
REST
Representational State Transfer:
using the principles of the World Wide Web to build applications
REST                  ful
web services try to leverage HTTP in its entirety
using specific architectural principles
2
common perspectives
on architectural design
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.
REST
       2
       Designer starts with the
       system needs and
       applies constraints to
       elements of the system.
CONSTRAINTS
 1  2    3
  4   5   6
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
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.
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
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.
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.)
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
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
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.
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
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.
6          Code on Demand

REST allows client functionality to be extended by
downloading and executing code in the form of scripts.
TESTING
RESTful APIs (with forms)
Download Simple
REST Client
Simple REST Client is a plugin for Chrome. Once
installed, you should have a button in the toolbar.
What else do you need?
• The API POST URL
• A POST string
• Content Type header
THE END.

Más contenido relacionado

La actualidad más candente

Exchange 2010 Poster
Exchange 2010 PosterExchange 2010 Poster
Exchange 2010 Poster
Paulo Freitas
 
Pinterest like site using REST and Bottle
Pinterest like site using REST and Bottle Pinterest like site using REST and Bottle
Pinterest like site using REST and Bottle
Gaurav Bhardwaj
 

La actualidad más candente (16)

Representational state transfer (rest) architectural style1.1
Representational state transfer (rest) architectural style1.1Representational state transfer (rest) architectural style1.1
Representational state transfer (rest) architectural style1.1
 
Apache ActiveMQ
Apache ActiveMQ Apache ActiveMQ
Apache ActiveMQ
 
Core concepts - mule
Core concepts - muleCore concepts - mule
Core concepts - mule
 
Mule hdfs connector
Mule hdfs connectorMule hdfs connector
Mule hdfs connector
 
Mule digital signature processor
Mule digital signature processorMule digital signature processor
Mule digital signature processor
 
IPCOM000242565D
IPCOM000242565DIPCOM000242565D
IPCOM000242565D
 
Anypoint enterprise security overview
Anypoint enterprise security overviewAnypoint enterprise security overview
Anypoint enterprise security overview
 
Exchange 2013 Architecture Poster
Exchange 2013 Architecture PosterExchange 2013 Architecture Poster
Exchange 2013 Architecture Poster
 
Representational State Transfer (REST)
Representational State Transfer (REST)Representational State Transfer (REST)
Representational State Transfer (REST)
 
componenets of osb12c
componenets of osb12ccomponenets of osb12c
componenets of osb12c
 
Session And Cookies In Servlets - Java
Session And Cookies In Servlets - JavaSession And Cookies In Servlets - Java
Session And Cookies In Servlets - Java
 
IRJET - Confidential Image De-Duplication in Cloud Storage
IRJET - Confidential Image De-Duplication in Cloud StorageIRJET - Confidential Image De-Duplication in Cloud Storage
IRJET - Confidential Image De-Duplication in Cloud Storage
 
Exchange 2010 Poster
Exchange 2010 PosterExchange 2010 Poster
Exchange 2010 Poster
 
Overview of Mule
Overview of MuleOverview of Mule
Overview of Mule
 
Pinterest like site using REST and Bottle
Pinterest like site using REST and Bottle Pinterest like site using REST and Bottle
Pinterest like site using REST and Bottle
 
Troubleshooting and Best Practices with WSO2 Enterprise Integrator
Troubleshooting and Best Practices with WSO2 Enterprise IntegratorTroubleshooting and Best Practices with WSO2 Enterprise Integrator
Troubleshooting and Best Practices with WSO2 Enterprise Integrator
 

Similar a About HTTP and REST

Similar a About HTTP and REST (20)

53 hui homework2
53 hui homework253 hui homework2
53 hui homework2
 
ReST (Representational State Transfer) Explained
ReST (Representational State Transfer) ExplainedReST (Representational State Transfer) Explained
ReST (Representational State Transfer) Explained
 
Lecture 12
Lecture 12Lecture 12
Lecture 12
 
Rest surekha
Rest surekhaRest surekha
Rest surekha
 
Rest API Automation with REST Assured
Rest API Automation with REST AssuredRest API Automation with REST Assured
Rest API Automation with REST Assured
 
Remoting and serialization
Remoting and serializationRemoting and serialization
Remoting and serialization
 
Unit 2
Unit 2Unit 2
Unit 2
 
REST - Representational State Transfer
REST - Representational State TransferREST - Representational State Transfer
REST - Representational State Transfer
 
Efficient Spring Data REST Development
Efficient Spring Data REST DevelopmentEfficient Spring Data REST Development
Efficient Spring Data REST Development
 
REST Introduction.ppt
REST Introduction.pptREST Introduction.ppt
REST Introduction.ppt
 
REST & RESTful APIs: The State of Confusion
REST & RESTful APIs: The State of ConfusionREST & RESTful APIs: The State of Confusion
REST & RESTful APIs: The State of Confusion
 
REST API
REST APIREST API
REST API
 
A REST API (also called a RESTful API or RESTful web API) is an application p...
A REST API (also called a RESTful API or RESTful web API) is an application p...A REST API (also called a RESTful API or RESTful web API) is an application p...
A REST API (also called a RESTful API or RESTful web API) is an application p...
 
IRJET- Rest API for E-Commerce Site
IRJET- Rest API for E-Commerce SiteIRJET- Rest API for E-Commerce Site
IRJET- Rest API for E-Commerce Site
 
Xamarin Workshop Noob to Master – Week 5
Xamarin Workshop Noob to Master – Week 5Xamarin Workshop Noob to Master – Week 5
Xamarin Workshop Noob to Master – Week 5
 
Marata
MarataMarata
Marata
 
ReSTful API Final
ReSTful API FinalReSTful API Final
ReSTful API Final
 
Subscription based control system to automate management of events for robots
Subscription based control system to automate management of events for robotsSubscription based control system to automate management of events for robots
Subscription based control system to automate management of events for robots
 
CHP-4.pptx
CHP-4.pptxCHP-4.pptx
CHP-4.pptx
 
Inter process communication
Inter process communicationInter process communication
Inter process communication
 

Más de Maggie Georgieva

From prospect to evangelist
From prospect to evangelistFrom prospect to evangelist
From prospect to evangelist
Maggie Georgieva
 
Reshaping the media landscape
Reshaping the media landscapeReshaping the media landscape
Reshaping the media landscape
Maggie Georgieva
 

Más de Maggie Georgieva (19)

Creating a Successful Brand on Social Media with Remarkable Stories
Creating a Successful Brand on Social Media with Remarkable StoriesCreating a Successful Brand on Social Media with Remarkable Stories
Creating a Successful Brand on Social Media with Remarkable Stories
 
How to Craft An Effective Landing Page and Pitch
How to Craft An Effective Landing Page and PitchHow to Craft An Effective Landing Page and Pitch
How to Craft An Effective Landing Page and Pitch
 
Happy Baba Marta!
Happy Baba Marta!Happy Baba Marta!
Happy Baba Marta!
 
From prospect to evangelist
From prospect to evangelistFrom prospect to evangelist
From prospect to evangelist
 
Reshaping the media landscape
Reshaping the media landscapeReshaping the media landscape
Reshaping the media landscape
 
PR Portfolio
PR PortfolioPR Portfolio
PR Portfolio
 
Print Lay-Outs
Print Lay-OutsPrint Lay-Outs
Print Lay-Outs
 
Alumni Embrace International Opportunities
Alumni Embrace International OpportunitiesAlumni Embrace International Opportunities
Alumni Embrace International Opportunities
 
Peculiarities of education abroad
Peculiarities of education abroadPeculiarities of education abroad
Peculiarities of education abroad
 
Social Networks in World Politics and Economics
Social Networks in World Politics and EconomicsSocial Networks in World Politics and Economics
Social Networks in World Politics and Economics
 
Falling Value of the Euro Affects Students
Falling Value of the Euro Affects StudentsFalling Value of the Euro Affects Students
Falling Value of the Euro Affects Students
 
How Holidays Change for International Students
How Holidays Change for International StudentsHow Holidays Change for International Students
How Holidays Change for International Students
 
Women's Image Globally
Women's Image GloballyWomen's Image Globally
Women's Image Globally
 
How International Students Celebrate in The US
How International Students Celebrate in The USHow International Students Celebrate in The US
How International Students Celebrate in The US
 
Study Abroad
Study AbroadStudy Abroad
Study Abroad
 
Looking back at 2009
Looking back at 2009Looking back at 2009
Looking back at 2009
 
Employment for International Students
Employment for International StudentsEmployment for International Students
Employment for International Students
 
Languages
LanguagesLanguages
Languages
 
African and Caribbean Day at Mount Holyoke
African and Caribbean Day at Mount HolyokeAfrican and Caribbean Day at Mount Holyoke
African and Caribbean Day at Mount Holyoke
 

Último

Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Victor Rentea
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 

Último (20)

Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering Developers
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 

About HTTP and REST

  • 1. HTTP The protocol that allows for sending docs back and forth on the web.
  • 2. client role server role
  • 3. client role server role initiates responds interaction
  • 5. includes metadata and HTTP methods header body includes data you want to transfer (text, pics, HTML, XML)
  • 6. The response specifies the content type of the body in the Content Type field (e.g. text/html or application/json)
  • 7. HTTP REQUEST METHODS GET POST PUT DELETE
  • 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)
  • 9. REST Representational State Transfer: using the principles of the World Wide Web to build applications
  • 10. REST ful web services try to leverage HTTP in its entirety using specific architectural principles
  • 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.
  • 14. CONSTRAINTS 1 2 3 4 5 6
  • 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.
  • 27. Download Simple REST Client Simple REST Client is a plugin for Chrome. Once installed, you should have a button in the toolbar.
  • 28.
  • 29. What else do you need? • The API POST URL • A POST string • Content Type header
  • 30.

Notas del editor

  1. 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>