SlideShare a Scribd company logo
Christopher Bartling
Nick Spilman
Kevin Hakanson
Basic REST concepts

    Defining your Resource-oriented architecture

    HTTP status codes and error handling

    Content-type negotiation

    Using AJAX with REST

    Versioning REST APIs

    Caching and other performance

    considerations
REpresentational State Transfer

    Architecture style or design criteria

     Not a standard
    Stateless, client-server, cacheable

    communications protocol
    Use HTTP requests to post, read, and delete

    data.
    Lightweight

    Nouns as URI, verbs as HTTP method

Resource

     Anything that important enough to be referenced
      in its singularity
     Can be physical object or an abstract concept
     Every resource has at least one name
    Resources can be a container of other

    resources
     Containers are always resources
     Composite design pattern
Resource representation

     Any useful information about the state of a
      resource
     Specified through distinct URI or content
      negotiation through headers
    Canonical resource URI

     Independent of format or locale language
     Can be specified in Content-Location response
     header of representation response
GET

    http://www.example.com/v1/hr/employees/19328389

    POST

    http://www.example.com/v1/hr/employees

    DELETE

    http://www.example.com/v1/hr/employees/14283949

    PUT

    http://www.example.com/v1/hr/employees/13448784
Addressability

     Resources are identified by URIs
    Statelessness

     No connection state maintained between REST
      invocations
    Connectedness

     Resources should link together in their
      representations
    Uniform interface

     HTTP GET, PUT, POST, DELETE, HEAD, OPTIONS
     HTTP method header
     HTTP status codes
The name and address of a resource

     The scoping information to resources
     Principle of addressability
    Should be descriptive

    Unique URIs are exposed for every resource

    available from a RESTful system
     Every URI designates exactly one resource
    URIs are discoverable by your clients

No state stored on the server

    Every HTTP request executes in complete

    isolation on the server
    Simpler to design and evolve

    Easier to scale

    Avoid using HTTP sessions and cookies

    No side-effects

Standardized

       GET
       POST
       PUT
       DELETE
       HEAD
       OPTIONS
    Represents invocation action

    Resources expose uniform interface

Primary means of reporting the outcome of a

    REST operation
     Use the entity-body to add ancillary qualifiers to
      the outcome
     Do not send back resource representations for
      anything other than GET—negative impact on
      performance optimizations
    See Appendix B of RESTful Web Services

    book for top 42 HTTP status codes
GET and HEAD requests should not cause any

    disastrous changes to the server-side

    No side effects!

     Client should not be making requests just for the
     side effects

    Avoid exposing unsafe operations through

    GET
Multiple invocations of an operation results in

    the same result state as a single invocation

    Idempotent methods: GET, HEAD, PUT,

    DELETE , OPTIONS

    Not idempotent: POST

When creating and updating resources…

     PUT if, and only if, you can fully specify the full
      content of the resource
     POST if you are sending a command to create or
      update one or more subordinates of the specified
      resource
     With POST, the server will determine resource URI
    Use Location header in the POST response to

    specify new resource URI(s) if applicable
HTTPS and SSL certificate validation

    5 main HTTP methods

     GET, HEAD, POST, PUT, DELETE
    Customization of the data sent in the entity-

    body of a PUT or POST request
    Customization of HTTP headers

    Access to the response status code and

    headers
    Communicate through HTTP proxies

Transfer and handle compressed data

     Request: Accept-Encoding header
     Response: Encoding header
    Cache responses to requests

     Conditional GETs
    Common forms of HTTP authentication

     Basic, Digest, and WSSE
    Transparently follow HTTP redirects

Hierarchical

     Encode data into path variables on the URI
     http://maps.example.com/Earth/Europe/France/Paris
    No hierarchy

     Combine into one path variable, separated by
      commas or semicolons
     Use commas when order is important, semicolons
      when it doesn’t
     http://maps.example.com/Earth/24.9195,17.821
Algorithmic resources

     Use query variables
     http://www.google.com/search?q=rest
Version your services!



    Incorporate the version into the URI

     Set version to the first path variable
     GET /v1/users/34923408


    Representations should also be versioned

     Include version information in the representation
Most resources do not change much



    Saves client and server processing time and

    network bandwidth

    Implemented using HTTP headers

     Response headers: Last-Modified and ETag
     Request headers: If-Modified-Since and If-None-
     Match
Initial request for resource representation
Request

    GET /v1/users/10572 HTTP/1.1


    Response

    HTTP/1.1 200 OK
    Last-Modified: Mon, 13 Apr 2009 18:00:00 GMT
    ETag: 1239646841000
    Cache-Control: must-revalidate
    Expires: Thu, 01 Jan 1970 00:00:00 GMT
    Date: Mon, 13 Apr 2009 18:46:00 GMT
Subsequent requests for resource
representation
Request

    GET /v1/users/10572 HTTP/1.1
    If-Modified-Since: Mon, 13 Apr 2009 18:00:00 GMT
    If-None-Match: 1239646841000


    Response

    HTTP/1.1 304 Not Modified
    Date: Mon, 13 Apr 2009 18:47:00 GMT
Microsoft Internet Explorer

     Requires the Expires: -1 header
     Prevents caching in IE
     http://support.microsoft.com/kb/234067
Tools

     .NET
      ▪ Windows Communication Foundation (WCF)
     Java
      ▪ Spring MVC 3.0
      ▪ JAX-RS: CXF, Jersey, RESTEasy, RESTlet
    Design the REST API

     Don’t just let it happen!
     Seek out resources in your domain
Answer the following questions, in order:

    1. What are the URIs? What are the resources of
       your application?
    2. What is the representational format for the
       resources?
    3. What methods are supported at each URI?
    4. What status codes could be returned for each
       method?
Resources can be served in different

    representations
     XML, JSON, HTML, etc.
    Content negotiation methods

     Headers
      ▪ Accept or Content-Type
     Query parameter
      ▪ GET /v1/users/10572?format=json
     URI extension
      ▪ GET /v1/users/10572.xml
Tools

     Curl
     Apache HttpClient and JUnit
     Fiddler (Windows), HTTP Scoop (OS X), WireShark
Using REST as a RPC-like mechanism



    Overusing POST



    Putting actions in the URI



    Disguising a service as a resource



    Maintaining sessions on the server

RESTful Web Services. Leonard Richardson and Sam Ruby.

    http://jcalcote.wordpress.com/2008/10/16/put-or-post-the-rest-of-the-story/

    http://www.elharo.com/blog/software-development/web-development/2005/12/08/post-

    vs-put/
    http://www.xml.com/pub/a/2004/12/01/restful-web.html

    http://www.xml.com/pub/a/2004/03/17/udell.html

    http://www.ics.uci.edu/~fielding/pubs/dissertation/top.htm

    http://www.mozilla.org/projects/netlib/http/http-caching-faq.html

    http://www.w3.org/Protocols/rfc2616/rfc2616-sec13.html

RESTful Web Services

More Related Content

What's hot

An Introduction To REST API
An Introduction To REST APIAn Introduction To REST API
An Introduction To REST API
Aniruddh Bhilvare
 
REST & RESTful Web Services
REST & RESTful Web ServicesREST & RESTful Web Services
REST & RESTful Web Services
Halil Burak Cetinkaya
 
Rest web services
Rest web servicesRest web services
Rest web services
Paulo Gandra de Sousa
 
RESTful API - Best Practices
RESTful API - Best PracticesRESTful API - Best Practices
RESTful API - Best Practices
Tricode (part of Dept)
 
Restful Web Services
Restful Web ServicesRestful Web Services
Restful Web Services
Angelin R
 
Understanding REST APIs in 5 Simple Steps
Understanding REST APIs in 5 Simple StepsUnderstanding REST APIs in 5 Simple Steps
Understanding REST APIs in 5 Simple Steps
Tessa Mero
 
REST-API introduction for developers
REST-API introduction for developersREST-API introduction for developers
REST-API introduction for developers
Patrick Savalle
 
Spring Boot and REST API
Spring Boot and REST APISpring Boot and REST API
Spring Boot and REST API
07.pallav
 
Restful api design
Restful api designRestful api design
Restful api design
Mizan Riqzia
 
Introduction to REST - API
Introduction to REST - APIIntroduction to REST - API
Introduction to REST - API
Chetan Gadodia
 
What Is Express JS?
What Is Express JS?What Is Express JS?
What Is Express JS?
Simplilearn
 
ReST (Representational State Transfer) Explained
ReST (Representational State Transfer) ExplainedReST (Representational State Transfer) Explained
ReST (Representational State Transfer) Explained
Dhananjay Nene
 
Spring mvc
Spring mvcSpring mvc
Spring mvc
Pravin Pundge
 
Learn REST in 18 Slides
Learn REST in 18 SlidesLearn REST in 18 Slides
Learn REST in 18 Slides
Suraj Gupta
 
Web api
Web apiWeb api
Rest assured
Rest assuredRest assured
Rest assured
Varun Deshpande
 
API
APIAPI
REST API Design
REST API DesignREST API Design
REST API Design
Devi Kiran G
 
API Testing Using REST Assured with TestNG
API Testing Using REST Assured with TestNGAPI Testing Using REST Assured with TestNG
API Testing Using REST Assured with TestNG
Siddharth Sharma
 
Spring annotations notes
Spring annotations notesSpring annotations notes
Spring annotations notes
Vipul Singh
 

What's hot (20)

An Introduction To REST API
An Introduction To REST APIAn Introduction To REST API
An Introduction To REST API
 
REST & RESTful Web Services
REST & RESTful Web ServicesREST & RESTful Web Services
REST & RESTful Web Services
 
Rest web services
Rest web servicesRest web services
Rest web services
 
RESTful API - Best Practices
RESTful API - Best PracticesRESTful API - Best Practices
RESTful API - Best Practices
 
Restful Web Services
Restful Web ServicesRestful Web Services
Restful Web Services
 
Understanding REST APIs in 5 Simple Steps
Understanding REST APIs in 5 Simple StepsUnderstanding REST APIs in 5 Simple Steps
Understanding REST APIs in 5 Simple Steps
 
REST-API introduction for developers
REST-API introduction for developersREST-API introduction for developers
REST-API introduction for developers
 
Spring Boot and REST API
Spring Boot and REST APISpring Boot and REST API
Spring Boot and REST API
 
Restful api design
Restful api designRestful api design
Restful api design
 
Introduction to REST - API
Introduction to REST - APIIntroduction to REST - API
Introduction to REST - API
 
What Is Express JS?
What Is Express JS?What Is Express JS?
What Is Express JS?
 
ReST (Representational State Transfer) Explained
ReST (Representational State Transfer) ExplainedReST (Representational State Transfer) Explained
ReST (Representational State Transfer) Explained
 
Spring mvc
Spring mvcSpring mvc
Spring mvc
 
Learn REST in 18 Slides
Learn REST in 18 SlidesLearn REST in 18 Slides
Learn REST in 18 Slides
 
Web api
Web apiWeb api
Web api
 
Rest assured
Rest assuredRest assured
Rest assured
 
API
APIAPI
API
 
REST API Design
REST API DesignREST API Design
REST API Design
 
API Testing Using REST Assured with TestNG
API Testing Using REST Assured with TestNGAPI Testing Using REST Assured with TestNG
API Testing Using REST Assured with TestNG
 
Spring annotations notes
Spring annotations notesSpring annotations notes
Spring annotations notes
 

Viewers also liked

REST Presentation
REST PresentationREST Presentation
REST Presentation
Alexandros Marinos
 
Some REST Design Patterns (and Anti-Patterns) - SOA Symposium 2009
Some REST Design Patterns (and Anti-Patterns) - SOA Symposium 2009Some REST Design Patterns (and Anti-Patterns) - SOA Symposium 2009
Some REST Design Patterns (and Anti-Patterns) - SOA Symposium 2009Cesare Pautasso
 
Wsdl
WsdlWsdl
Nfc ppt
Nfc pptNfc ppt
Nfc ppt
Vivek Prasad
 
NEAR FIELD COMMUNICATION
NEAR FIELD COMMUNICATIONNEAR FIELD COMMUNICATION
NEAR FIELD COMMUNICATION
Harisankar U K
 
NFC (Near Field Communication)
NFC (Near Field Communication)NFC (Near Field Communication)
NFC (Near Field Communication)Pushpak Elleedu
 
HyperText Transfer Protocol (HTTP)
HyperText Transfer Protocol (HTTP)HyperText Transfer Protocol (HTTP)
HyperText Transfer Protocol (HTTP)
Gurjot Singh
 

Viewers also liked (8)

REST Presentation
REST PresentationREST Presentation
REST Presentation
 
Some REST Design Patterns (and Anti-Patterns) - SOA Symposium 2009
Some REST Design Patterns (and Anti-Patterns) - SOA Symposium 2009Some REST Design Patterns (and Anti-Patterns) - SOA Symposium 2009
Some REST Design Patterns (and Anti-Patterns) - SOA Symposium 2009
 
Wsdl
WsdlWsdl
Wsdl
 
Nfc ppt
Nfc pptNfc ppt
Nfc ppt
 
NEAR FIELD COMMUNICATION
NEAR FIELD COMMUNICATIONNEAR FIELD COMMUNICATION
NEAR FIELD COMMUNICATION
 
NFC (Near Field Communication)
NFC (Near Field Communication)NFC (Near Field Communication)
NFC (Near Field Communication)
 
HyperText Transfer Protocol (HTTP)
HyperText Transfer Protocol (HTTP)HyperText Transfer Protocol (HTTP)
HyperText Transfer Protocol (HTTP)
 
Verb powerpoint
Verb powerpointVerb powerpoint
Verb powerpoint
 

Similar to RESTful Web Services

01. http basics v27
01. http basics v2701. http basics v27
01. http basics v27
Eoin Keary
 
RESTful SOA - 中科院暑期讲座
RESTful SOA - 中科院暑期讲座RESTful SOA - 中科院暑期讲座
RESTful SOA - 中科院暑期讲座Li Yi
 
Doing REST Right
Doing REST RightDoing REST Right
Doing REST Right
Kerry Buckley
 
RESTful services
RESTful servicesRESTful services
RESTful servicesgouthamrv
 
Rest with Java EE 6 , Security , Backbone.js
Rest with Java EE 6 , Security , Backbone.jsRest with Java EE 6 , Security , Backbone.js
Rest with Java EE 6 , Security , Backbone.jsCarol McDonald
 
REST & RESTful Web Service
REST & RESTful Web ServiceREST & RESTful Web Service
REST & RESTful Web Service
Hoan Vu Tran
 
RESTful Web Services with JAX-RS
RESTful Web Services with JAX-RSRESTful Web Services with JAX-RS
RESTful Web Services with JAX-RS
Carol McDonald
 
Restful webservice
Restful webserviceRestful webservice
Restful webservice
Dong Ngoc
 
A RESTful introduction
A RESTful introductionA RESTful introduction
A RESTful introduction
Daniel Toader
 
OpenTravel Advisory Forum 2012 REST XML Resources
OpenTravel Advisory Forum 2012 REST XML ResourcesOpenTravel Advisory Forum 2012 REST XML Resources
OpenTravel Advisory Forum 2012 REST XML Resources
OpenTravel Alliance
 
Resource-Oriented Web Services
Resource-Oriented Web ServicesResource-Oriented Web Services
Resource-Oriented Web Services
Bradley Holt
 
KMUTNB - Internet Programming 2/7
KMUTNB - Internet Programming 2/7KMUTNB - Internet Programming 2/7
KMUTNB - Internet Programming 2/7
phuphax
 
HTTP Basics Demo
HTTP Basics DemoHTTP Basics Demo
HTTP Basics Demo
InMobi Technology
 
Woa. Reloaded
Woa. ReloadedWoa. Reloaded
Woa. Reloaded
Emiliano Pecis
 
REST Introduction (PHP London)
REST Introduction (PHP London)REST Introduction (PHP London)
REST Introduction (PHP London)
Paul James
 
REST Easy with AngularJS - ng-grid CRUD EXAMPLE
REST Easy with AngularJS - ng-grid CRUD EXAMPLEREST Easy with AngularJS - ng-grid CRUD EXAMPLE
REST Easy with AngularJS - ng-grid CRUD EXAMPLE
reneechemel
 
REST Easy with AngularJS - ng-grid CRUD Example
REST Easy with AngularJS - ng-grid CRUD ExampleREST Easy with AngularJS - ng-grid CRUD Example
REST Easy with AngularJS - ng-grid CRUD Example
Backand Cohen
 
RESTful Web Services
RESTful Web ServicesRESTful Web Services
RESTful Web Services
Gordon Dickens
 

Similar to RESTful Web Services (20)

01. http basics v27
01. http basics v2701. http basics v27
01. http basics v27
 
RESTful SOA - 中科院暑期讲座
RESTful SOA - 中科院暑期讲座RESTful SOA - 中科院暑期讲座
RESTful SOA - 中科院暑期讲座
 
Doing REST Right
Doing REST RightDoing REST Right
Doing REST Right
 
RESTful services
RESTful servicesRESTful services
RESTful services
 
Web Scraping with PHP
Web Scraping with PHPWeb Scraping with PHP
Web Scraping with PHP
 
Rest with Java EE 6 , Security , Backbone.js
Rest with Java EE 6 , Security , Backbone.jsRest with Java EE 6 , Security , Backbone.js
Rest with Java EE 6 , Security , Backbone.js
 
Rest
RestRest
Rest
 
REST & RESTful Web Service
REST & RESTful Web ServiceREST & RESTful Web Service
REST & RESTful Web Service
 
RESTful Web Services with JAX-RS
RESTful Web Services with JAX-RSRESTful Web Services with JAX-RS
RESTful Web Services with JAX-RS
 
Restful webservice
Restful webserviceRestful webservice
Restful webservice
 
A RESTful introduction
A RESTful introductionA RESTful introduction
A RESTful introduction
 
OpenTravel Advisory Forum 2012 REST XML Resources
OpenTravel Advisory Forum 2012 REST XML ResourcesOpenTravel Advisory Forum 2012 REST XML Resources
OpenTravel Advisory Forum 2012 REST XML Resources
 
Resource-Oriented Web Services
Resource-Oriented Web ServicesResource-Oriented Web Services
Resource-Oriented Web Services
 
KMUTNB - Internet Programming 2/7
KMUTNB - Internet Programming 2/7KMUTNB - Internet Programming 2/7
KMUTNB - Internet Programming 2/7
 
HTTP Basics Demo
HTTP Basics DemoHTTP Basics Demo
HTTP Basics Demo
 
Woa. Reloaded
Woa. ReloadedWoa. Reloaded
Woa. Reloaded
 
REST Introduction (PHP London)
REST Introduction (PHP London)REST Introduction (PHP London)
REST Introduction (PHP London)
 
REST Easy with AngularJS - ng-grid CRUD EXAMPLE
REST Easy with AngularJS - ng-grid CRUD EXAMPLEREST Easy with AngularJS - ng-grid CRUD EXAMPLE
REST Easy with AngularJS - ng-grid CRUD EXAMPLE
 
REST Easy with AngularJS - ng-grid CRUD Example
REST Easy with AngularJS - ng-grid CRUD ExampleREST Easy with AngularJS - ng-grid CRUD Example
REST Easy with AngularJS - ng-grid CRUD Example
 
RESTful Web Services
RESTful Web ServicesRESTful Web Services
RESTful Web Services
 

More from Christopher Bartling

JavaScript Test-Driven Development with Jasmine 2.0 and Karma
JavaScript Test-Driven Development with Jasmine 2.0 and Karma JavaScript Test-Driven Development with Jasmine 2.0 and Karma
JavaScript Test-Driven Development with Jasmine 2.0 and Karma
Christopher Bartling
 
Acceptance Test-driven Development with Cucumber-jvm
Acceptance Test-driven Development with Cucumber-jvmAcceptance Test-driven Development with Cucumber-jvm
Acceptance Test-driven Development with Cucumber-jvm
Christopher Bartling
 
JavaScript TDD with Jasmine and Karma
JavaScript TDD with Jasmine and KarmaJavaScript TDD with Jasmine and Karma
JavaScript TDD with Jasmine and Karma
Christopher Bartling
 
Building Tropo Apps with Grails
Building Tropo Apps with GrailsBuilding Tropo Apps with Grails
Building Tropo Apps with Grails
Christopher Bartling
 
CoffeeScript By Example
CoffeeScript By ExampleCoffeeScript By Example
CoffeeScript By Example
Christopher Bartling
 
Acceptance Test Driven Development With Spec Flow And Friends
Acceptance Test Driven Development With Spec Flow And FriendsAcceptance Test Driven Development With Spec Flow And Friends
Acceptance Test Driven Development With Spec Flow And Friends
Christopher Bartling
 
Introduction To Grails
Introduction To GrailsIntroduction To Grails
Introduction To Grails
Christopher Bartling
 
Cucumber, Cuke4Duke, and Groovy
Cucumber, Cuke4Duke, and GroovyCucumber, Cuke4Duke, and Groovy
Cucumber, Cuke4Duke, and Groovy
Christopher Bartling
 
Test Driven In Groovy
Test Driven In GroovyTest Driven In Groovy
Test Driven In Groovy
Christopher Bartling
 
iPhone OS: The Next Killer Platform
iPhone OS: The Next Killer PlatformiPhone OS: The Next Killer Platform
iPhone OS: The Next Killer Platform
Christopher Bartling
 
Grails Overview
Grails OverviewGrails Overview
Grails Overview
Christopher Bartling
 

More from Christopher Bartling (12)

JavaScript Test-Driven Development with Jasmine 2.0 and Karma
JavaScript Test-Driven Development with Jasmine 2.0 and Karma JavaScript Test-Driven Development with Jasmine 2.0 and Karma
JavaScript Test-Driven Development with Jasmine 2.0 and Karma
 
Acceptance Test-driven Development with Cucumber-jvm
Acceptance Test-driven Development with Cucumber-jvmAcceptance Test-driven Development with Cucumber-jvm
Acceptance Test-driven Development with Cucumber-jvm
 
JavaScript TDD with Jasmine and Karma
JavaScript TDD with Jasmine and KarmaJavaScript TDD with Jasmine and Karma
JavaScript TDD with Jasmine and Karma
 
Building Tropo Apps with Grails
Building Tropo Apps with GrailsBuilding Tropo Apps with Grails
Building Tropo Apps with Grails
 
CoffeeScript By Example
CoffeeScript By ExampleCoffeeScript By Example
CoffeeScript By Example
 
Acceptance Test Driven Development With Spec Flow And Friends
Acceptance Test Driven Development With Spec Flow And FriendsAcceptance Test Driven Development With Spec Flow And Friends
Acceptance Test Driven Development With Spec Flow And Friends
 
Introduction To Grails
Introduction To GrailsIntroduction To Grails
Introduction To Grails
 
Cucumber, Cuke4Duke, and Groovy
Cucumber, Cuke4Duke, and GroovyCucumber, Cuke4Duke, and Groovy
Cucumber, Cuke4Duke, and Groovy
 
Test Driven In Groovy
Test Driven In GroovyTest Driven In Groovy
Test Driven In Groovy
 
iPhone OS: The Next Killer Platform
iPhone OS: The Next Killer PlatformiPhone OS: The Next Killer Platform
iPhone OS: The Next Killer Platform
 
Grails Overview
Grails OverviewGrails Overview
Grails Overview
 
Rich Web Clients 20081118
Rich Web Clients 20081118Rich Web Clients 20081118
Rich Web Clients 20081118
 

Recently uploaded

From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
Product School
 
"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi
Fwdays
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
Safe Software
 
Search and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical FuturesSearch and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical Futures
Bhaskar Mitra
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Inflectra
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
Paul Groth
 
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptxIOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
Abida Shariff
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
UiPathCommunity
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Product School
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Ramesh Iyer
 
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Tobias Schneck
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
DianaGray10
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
James Anderson
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
DianaGray10
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
Kari Kakkonen
 
Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
OnBoard
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
ThousandEyes
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance
 

Recently uploaded (20)

From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
 
"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
 
Search and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical FuturesSearch and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical Futures
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
 
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptxIOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
 
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
 
Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
 

RESTful Web Services

  • 2. Basic REST concepts  Defining your Resource-oriented architecture  HTTP status codes and error handling  Content-type negotiation  Using AJAX with REST  Versioning REST APIs  Caching and other performance  considerations
  • 3. REpresentational State Transfer  Architecture style or design criteria   Not a standard Stateless, client-server, cacheable  communications protocol Use HTTP requests to post, read, and delete  data. Lightweight  Nouns as URI, verbs as HTTP method 
  • 4. Resource   Anything that important enough to be referenced in its singularity  Can be physical object or an abstract concept  Every resource has at least one name Resources can be a container of other  resources  Containers are always resources  Composite design pattern
  • 5. Resource representation   Any useful information about the state of a resource  Specified through distinct URI or content negotiation through headers Canonical resource URI   Independent of format or locale language  Can be specified in Content-Location response header of representation response
  • 6. GET  http://www.example.com/v1/hr/employees/19328389 POST  http://www.example.com/v1/hr/employees DELETE  http://www.example.com/v1/hr/employees/14283949 PUT  http://www.example.com/v1/hr/employees/13448784
  • 7. Addressability   Resources are identified by URIs Statelessness   No connection state maintained between REST invocations Connectedness   Resources should link together in their representations Uniform interface   HTTP GET, PUT, POST, DELETE, HEAD, OPTIONS  HTTP method header  HTTP status codes
  • 8. The name and address of a resource   The scoping information to resources  Principle of addressability Should be descriptive  Unique URIs are exposed for every resource  available from a RESTful system  Every URI designates exactly one resource URIs are discoverable by your clients 
  • 9. No state stored on the server  Every HTTP request executes in complete  isolation on the server Simpler to design and evolve  Easier to scale  Avoid using HTTP sessions and cookies  No side-effects 
  • 10. Standardized   GET  POST  PUT  DELETE  HEAD  OPTIONS Represents invocation action  Resources expose uniform interface 
  • 11.
  • 12.
  • 13.
  • 14.
  • 15.
  • 16. Primary means of reporting the outcome of a  REST operation  Use the entity-body to add ancillary qualifiers to the outcome  Do not send back resource representations for anything other than GET—negative impact on performance optimizations See Appendix B of RESTful Web Services  book for top 42 HTTP status codes
  • 17. GET and HEAD requests should not cause any  disastrous changes to the server-side No side effects!   Client should not be making requests just for the side effects Avoid exposing unsafe operations through  GET
  • 18. Multiple invocations of an operation results in  the same result state as a single invocation Idempotent methods: GET, HEAD, PUT,  DELETE , OPTIONS Not idempotent: POST 
  • 19. When creating and updating resources…   PUT if, and only if, you can fully specify the full content of the resource  POST if you are sending a command to create or update one or more subordinates of the specified resource  With POST, the server will determine resource URI Use Location header in the POST response to  specify new resource URI(s) if applicable
  • 20. HTTPS and SSL certificate validation  5 main HTTP methods   GET, HEAD, POST, PUT, DELETE Customization of the data sent in the entity-  body of a PUT or POST request Customization of HTTP headers  Access to the response status code and  headers Communicate through HTTP proxies 
  • 21. Transfer and handle compressed data   Request: Accept-Encoding header  Response: Encoding header Cache responses to requests   Conditional GETs Common forms of HTTP authentication   Basic, Digest, and WSSE Transparently follow HTTP redirects 
  • 22. Hierarchical   Encode data into path variables on the URI  http://maps.example.com/Earth/Europe/France/Paris No hierarchy   Combine into one path variable, separated by commas or semicolons  Use commas when order is important, semicolons when it doesn’t  http://maps.example.com/Earth/24.9195,17.821
  • 23. Algorithmic resources   Use query variables  http://www.google.com/search?q=rest
  • 24. Version your services!  Incorporate the version into the URI   Set version to the first path variable  GET /v1/users/34923408 Representations should also be versioned   Include version information in the representation
  • 25. Most resources do not change much  Saves client and server processing time and  network bandwidth Implemented using HTTP headers   Response headers: Last-Modified and ETag  Request headers: If-Modified-Since and If-None- Match
  • 26. Initial request for resource representation
  • 27. Request  GET /v1/users/10572 HTTP/1.1 Response  HTTP/1.1 200 OK Last-Modified: Mon, 13 Apr 2009 18:00:00 GMT ETag: 1239646841000 Cache-Control: must-revalidate Expires: Thu, 01 Jan 1970 00:00:00 GMT Date: Mon, 13 Apr 2009 18:46:00 GMT
  • 28. Subsequent requests for resource representation
  • 29. Request  GET /v1/users/10572 HTTP/1.1 If-Modified-Since: Mon, 13 Apr 2009 18:00:00 GMT If-None-Match: 1239646841000 Response  HTTP/1.1 304 Not Modified Date: Mon, 13 Apr 2009 18:47:00 GMT
  • 30. Microsoft Internet Explorer   Requires the Expires: -1 header  Prevents caching in IE http://support.microsoft.com/kb/234067
  • 31. Tools   .NET ▪ Windows Communication Foundation (WCF)  Java ▪ Spring MVC 3.0 ▪ JAX-RS: CXF, Jersey, RESTEasy, RESTlet Design the REST API   Don’t just let it happen!  Seek out resources in your domain
  • 32. Answer the following questions, in order:  1. What are the URIs? What are the resources of your application? 2. What is the representational format for the resources? 3. What methods are supported at each URI? 4. What status codes could be returned for each method?
  • 33. Resources can be served in different  representations  XML, JSON, HTML, etc. Content negotiation methods   Headers ▪ Accept or Content-Type  Query parameter ▪ GET /v1/users/10572?format=json  URI extension ▪ GET /v1/users/10572.xml
  • 34. Tools   Curl  Apache HttpClient and JUnit  Fiddler (Windows), HTTP Scoop (OS X), WireShark
  • 35. Using REST as a RPC-like mechanism  Overusing POST  Putting actions in the URI  Disguising a service as a resource  Maintaining sessions on the server 
  • 36.
  • 37. RESTful Web Services. Leonard Richardson and Sam Ruby.  http://jcalcote.wordpress.com/2008/10/16/put-or-post-the-rest-of-the-story/  http://www.elharo.com/blog/software-development/web-development/2005/12/08/post-  vs-put/ http://www.xml.com/pub/a/2004/12/01/restful-web.html  http://www.xml.com/pub/a/2004/03/17/udell.html  http://www.ics.uci.edu/~fielding/pubs/dissertation/top.htm  http://www.mozilla.org/projects/netlib/http/http-caching-faq.html  http://www.w3.org/Protocols/rfc2616/rfc2616-sec13.html 