SlideShare a Scribd company logo
RESTING ON HTTP
DEVELOPER WEEK - 17.06.2015
WHO AM I?
Maximilian Berghoff
Mayflower GmbH (Würzburg)
@ElectricMaxxx
Maximilian.Berghoff@mayflower.de
ABOUT?
REST = HTTP?
HTTP
GET /info HTTP/1.1
Host: www.expamle.dev
Content­Type: text/html
Header Request
<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF­8">
    <title>Information</title>
</head>
<body>
  <h1>Information about this page</h1>
  <p>Here you will get your information</p>
</body>
</html>
Content der Response
HTTP/1.1 200 OK
Content­Type: text/html; charset=UTF­8
..
           
Header Response
STATUS CODES
1XX - Bearbeitung dauert an (Intermediate)
2XX - Anfrage Erfolgreich
3XX - Umleitungen
4XX - Fehler in der Anfrage/beim Client
5XX - Fehler am Server
METHOD
SAVE METHOD?
GET
GET /BLOG/2/EDIT
GET /BLOG/2/EDIT
POST / PUT
POST
POST /users HTTP/1.1
Host: www.example.dev
Content­Type: application/json
{
    "firstName": "Max",
    "lastName": "Berghoff"
}
                        
POST request
HTTP/1.1 201 Created
Content­Type: application/json;
Content­Location: /users/3
{
    "id": "3",
    "firstName": "Max",
    "lastName": "Berghoff"
}
                        
POST response
PUT
PUT /users/3 HTTP/1.1
Host: www.example.dev
Content­Type: application/json
{
    "firstName": "Max",
    "lastName": "Berghoff",
    "email": "Maximilian.Berghoff@mayflower.de"
}
                        
PUT request
HTTP/1.1 200 OK
Content­Type: application/json;
{
    "id": "3",
    "firstName": "Max",
    "lastName": "Berghoff",
    "email": "Maximilian.Berghoff@mayflower.de"
}
                        
POST response
PATCH
POST / PUT / PATCH
DELETE
DELETE /users/3 HTTP/1.1
Host: www.example.dev
DELETE request
HTTP/1.1 204 No Content
Location: /users
DELETE response
OPTIONS
HEAD
ROY FIELDING
HTTP Spezification
DISERTATION
ARCHITECTURAL STYLES AND THE DESIGN OF NETWORK-BASED SOFTWARE ARCHITECTURES
DOCTOR OF PHILOSOPHY, 2000
4 CONSTRAINTS
1.
ADRESSIERBARKEIT
2.
REPRÄSENTATIONEN
3.
ZUSTANDSLOSIGKEIT
4.
OPERATIONEN
RESOURCEN?
JEDE INFORMATION KANN
RESOURCE SEIN
(HTML) Dokument
Bild
Liste von Resourcen
Alles was Ziel einer Referenz/eines Link sein kann.
REPRÄSENTATIONEN
{
    "userId": "3",
    "username": "ElectricMaxxx",
    "firstName": "Max",
    "lastName": "Berghoff",
    "email": "Maximilian.Berghoff@mayflower.de"
}
User als JSON
<user>
    <userId>3</userId>
    <userName>ElectricMaxxx</userName>
    <firstName>Maximilian</firstName>
    <lastName>Berghoff</lastName>
    <email>Maximilian.Berghoff@gmx.de</email>
</user>
User als XML
<ul>
    <li>
        <strong>Username: </strong> ElectricMaxxx
    </li>
    <li>
        <strong>FirstName: </strong> Max
    </li>
    <li>
        <strong>LastName: </strong> Berghoff
    </li>
    <li>
        <strong>Email: </strong> Maximilian.Berghoff@mayflower.de
    </li>
</ul>
User als HTML in einem Profil
WIE ERHALTE ICH DIE
GEWÜNSCHTE
REPRÄSENTATION?
IN DER URL
/users/3.json
Oder /users/3.xml
Oder /users/3.html
IM HEADER
GET /users/3
Content-Type: application/json
Oder Content-Type: application/xml
Oder Content-Type: text/html
WIE SOLL RESOURCE
AUSSEHEN?
HATEOAS
HYPERMEDIA
AS THE ENGINE OF
APPLICATION STATE
WTF?
<?xml version="1.0"?>
<user>
    <userName>ElectricMaxxx</userName>
    <firstName>Maximilian</firstName>
    <lastName>Berghoff</lastName>
    <email>Maximilian.Berghoff@gmx.de</email>
    <link rel="groups" href="/users/3/groups" />
    <link rel="roles" href="/users/3/roles" />
    <link rel="orders" href="/users/3/orders" />
</user>
JSON ?
HAL Spezifikation
"_links":{
    "self": { "href": "/users/3" }
},
"userId": "3",
"_embedded": {
    "orders": [{
        "_links": {
            "self": { "href": "users/3/orders/123"}
        }
    }],
    "groups": [{
        "_links": {
            "self": { "href": "users/3/orders/2"}
        }
    }]
}
ZURÜCK AUF NULL
GET /users/3 HTTP/1.1
Host: www.expamle.dev
Content­Type: application/xml
Request auf User mit der ID 3
HTTP/1.1 200 OK
Content­Type: application/xml
<?xml version="1.0"?>
<user>
    <userName>ElectricMaxxx</userName>
    <firstName>Maximilian</firstName>
    <lastName>Berghoff</lastName>
    <email>Maximilian.Berghoff@gmx.de</email>
    <link rel="groups" href="/users/3/groups" />
    <link rel="roles" href="/users/3/roles" />
    <link rel="orders" href="/users/3/orders" />
</user>
                        
Anwort des Services in XML
CONTRAINTS ERFÜLLT
-> REST = HTTP?
NEIN!!!
HYPETEXT TRANSFER
PROTOCOL
REPRESENTATIONAL
STATE TRANSFER
I LOVE
RESTING ON HTTP
QUESTIONS ?
Ask now!
Twitter:   @ElectricMaxxx
Mail:   Maximilian.Berghoff@mayflower.de
THANK YOU!
< <

More Related Content

PDF
Webpage Designing in HTML
PPT
XHTML basics
PDF
Htaccess file tutorial and tips
PDF
Technical SEO: .htaccess & 301 Redirects
PPTX
Hyper Text Marup Language
PPTX
1 introduction to html
PPT
Lecture1and2
Webpage Designing in HTML
XHTML basics
Htaccess file tutorial and tips
Technical SEO: .htaccess & 301 Redirects
Hyper Text Marup Language
1 introduction to html
Lecture1and2

Viewers also liked (20)

PPTX
आम्ले आम्लारी आणि क्षार
PDF
Lptw proper-10 a-yc-ot lesson for sunday skol
PPT
PPT
Γεωγράφοι
PPT
PDF
Portfolio 2015
PPTX
знайомство з бібліотекою - філією №2 Івано-Франківської МЦБС
PDF
CV-2015 net
PDF
Portfolio 2015
PDF
PDF
Modelagem computacional
PPTX
क्रांतीयुग
PPTX
साधी यंत्रे
PPT
Manual de compra_nrfacil
PDF
Fns sst-apt- 27-passagem inferior
PDF
PORTFOLIO 2015 net
आम्ले आम्लारी आणि क्षार
Lptw proper-10 a-yc-ot lesson for sunday skol
Γεωγράφοι
Portfolio 2015
знайомство з бібліотекою - філією №2 Івано-Франківської МЦБС
CV-2015 net
Portfolio 2015
Modelagem computacional
क्रांतीयुग
साधी यंत्रे
Manual de compra_nrfacil
Fns sst-apt- 27-passagem inferior
PORTFOLIO 2015 net
Ad

Similar to RESTing on HTTP (20)

PDF
Resource-Oriented Web Services
ODP
RESTful Web Services with JAX-RS
PDF
Pragmatic REST aka praxisnahes Schnittstellendesign
PDF
HTTP by Hand: Exploring HTTP/1.0, 1.1 and 2.0
PDF
PHP MySQL Training : Module 3
PDF
Web Development with NodeJS
PPT
ReST-ful Resource Management
PDF
HTTP Basics Demo
ODP
Coding In Php
PPTX
Interactive web. O rly?
PPTX
HTTP fundamentals for developers
DOCX
1 Introduction to PHP Overview This lab walks y.docx
PPTX
Http2 kotlin
ODP
PHP Training: Module 1
PDF
OWASP Top 10 - Checkmarx Presentation at Polytechnic Institute of Cávado and Ave
ODP
Starting With Php
PPTX
01. http basics v27
PDF
Leverage HTTP to deliver cacheable websites - Codemotion Rome 2018
PDF
Leverage HTTP to deliver cacheable websites - Thijs Feryn - Codemotion Rome 2018
Resource-Oriented Web Services
RESTful Web Services with JAX-RS
Pragmatic REST aka praxisnahes Schnittstellendesign
HTTP by Hand: Exploring HTTP/1.0, 1.1 and 2.0
PHP MySQL Training : Module 3
Web Development with NodeJS
ReST-ful Resource Management
HTTP Basics Demo
Coding In Php
Interactive web. O rly?
HTTP fundamentals for developers
1 Introduction to PHP Overview This lab walks y.docx
Http2 kotlin
PHP Training: Module 1
OWASP Top 10 - Checkmarx Presentation at Polytechnic Institute of Cávado and Ave
Starting With Php
01. http basics v27
Leverage HTTP to deliver cacheable websites - Codemotion Rome 2018
Leverage HTTP to deliver cacheable websites - Thijs Feryn - Codemotion Rome 2018
Ad

More from Maximilian Berghoff (20)

PDF
Sustainability in der deploy pipeline
PDF
Development is for future
PDF
Development is for future
PDF
Natural language understanding meets php php ruhr 2018
PDF
NLU meets PHP
PDF
Angular Mini Hackathon Code Talks 2019
PDF
Search engine optimization for symfony developers
PDF
Introduction into FrOSCon PHP Track
PDF
Angular Workshop FrOSCon 2018
PDF
API Plattform - A Backend in Minutes
PDF
The content manager loves the tree
PPTX
Aspects Of Code Quality meetup
PDF
Reactive Javascript - FrOSCon - 2016
PDF
Extending a symfony application by cms features
PDF
Concepts of Code Quality
PDF
Mit dem API ins CMS
PDF
Reactive java script mit rxjs basta! 2016
PDF
Eine Symfony Application um CMS-Funktionen erweitern
PDF
RESTing on HTTP - FrOSCon 10 - 2015-08-23
PPT
Symfony-CMF/SeoBundle - unKonf
Sustainability in der deploy pipeline
Development is for future
Development is for future
Natural language understanding meets php php ruhr 2018
NLU meets PHP
Angular Mini Hackathon Code Talks 2019
Search engine optimization for symfony developers
Introduction into FrOSCon PHP Track
Angular Workshop FrOSCon 2018
API Plattform - A Backend in Minutes
The content manager loves the tree
Aspects Of Code Quality meetup
Reactive Javascript - FrOSCon - 2016
Extending a symfony application by cms features
Concepts of Code Quality
Mit dem API ins CMS
Reactive java script mit rxjs basta! 2016
Eine Symfony Application um CMS-Funktionen erweitern
RESTing on HTTP - FrOSCon 10 - 2015-08-23
Symfony-CMF/SeoBundle - unKonf

Recently uploaded (20)

PDF
Smart Home Technology for Health Monitoring (www.kiu.ac.ug)
PPTX
presentation_pfe-universite-molay-seltan.pptx
PDF
💰 𝐔𝐊𝐓𝐈 𝐊𝐄𝐌𝐄𝐍𝐀𝐍𝐆𝐀𝐍 𝐊𝐈𝐏𝐄𝐑𝟒𝐃 𝐇𝐀𝐑𝐈 𝐈𝐍𝐈 𝟐𝟎𝟐𝟓 💰
PPT
250152213-Excitation-SystemWERRT (1).ppt
PPTX
June-4-Sermon-Powerpoint.pptx USE THIS FOR YOUR MOTIVATION
PPTX
Mathew Digital SEO Checklist Guidlines 2025
PDF
Exploring VPS Hosting Trends for SMBs in 2025
PDF
Unit-1 introduction to cyber security discuss about how to secure a system
PDF
FINAL CALL-6th International Conference on Networks & IOT (NeTIOT 2025)
DOC
Rose毕业证学历认证,利物浦约翰摩尔斯大学毕业证国外本科毕业证
PPTX
Digital Literacy And Online Safety on internet
PPTX
newyork.pptxirantrafgshenepalchinachinane
PPTX
artificial intelligence overview of it and more
PDF
mera desh ae watn.(a source of motivation and patriotism to the youth of the ...
PPT
415456121-Jiwratrwecdtwfdsfwgdwedvwe dbwsdjsadca-EVN.ppt
PDF
Best Practices for Testing and Debugging Shopify Third-Party API Integrations...
PPT
isotopes_sddsadsaadasdasdasdasdsa1213.ppt
PPTX
Power Point - Lesson 3_2.pptx grad school presentation
PDF
Sims 4 Historia para lo sims 4 para jugar
PPT
Design_with_Watersergyerge45hrbgre4top (1).ppt
Smart Home Technology for Health Monitoring (www.kiu.ac.ug)
presentation_pfe-universite-molay-seltan.pptx
💰 𝐔𝐊𝐓𝐈 𝐊𝐄𝐌𝐄𝐍𝐀𝐍𝐆𝐀𝐍 𝐊𝐈𝐏𝐄𝐑𝟒𝐃 𝐇𝐀𝐑𝐈 𝐈𝐍𝐈 𝟐𝟎𝟐𝟓 💰
250152213-Excitation-SystemWERRT (1).ppt
June-4-Sermon-Powerpoint.pptx USE THIS FOR YOUR MOTIVATION
Mathew Digital SEO Checklist Guidlines 2025
Exploring VPS Hosting Trends for SMBs in 2025
Unit-1 introduction to cyber security discuss about how to secure a system
FINAL CALL-6th International Conference on Networks & IOT (NeTIOT 2025)
Rose毕业证学历认证,利物浦约翰摩尔斯大学毕业证国外本科毕业证
Digital Literacy And Online Safety on internet
newyork.pptxirantrafgshenepalchinachinane
artificial intelligence overview of it and more
mera desh ae watn.(a source of motivation and patriotism to the youth of the ...
415456121-Jiwratrwecdtwfdsfwgdwedvwe dbwsdjsadca-EVN.ppt
Best Practices for Testing and Debugging Shopify Third-Party API Integrations...
isotopes_sddsadsaadasdasdasdasdsa1213.ppt
Power Point - Lesson 3_2.pptx grad school presentation
Sims 4 Historia para lo sims 4 para jugar
Design_with_Watersergyerge45hrbgre4top (1).ppt

RESTing on HTTP