SlideShare ist ein Scribd-Unternehmen logo
1 von 62
Downloaden Sie, um offline zu lesen
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!
< <

Weitere ähnliche Inhalte

Andere mochten auch

Lptw proper-10 a-yc-ot lesson for sunday skol
Lptw proper-10 a-yc-ot lesson for sunday skolLptw proper-10 a-yc-ot lesson for sunday skol
Lptw proper-10 a-yc-ot lesson for sunday skol
Gemma Diaz
 
Γεωγράφοι
ΓεωγράφοιΓεωγράφοι
Γεωγράφοι
stne
 
PORTFOLIO 2015 net
PORTFOLIO 2015 netPORTFOLIO 2015 net
PORTFOLIO 2015 net
3darchdeco
 

Andere mochten auch (20)

आम्ले आम्लारी आणि क्षार
आम्ले आम्लारी आणि क्षारआम्ले आम्लारी आणि क्षार
आम्ले आम्लारी आणि क्षार
 
Animals
AnimalsAnimals
Animals
 
Rest
RestRest
Rest
 
Lptw proper-10 a-yc-ot lesson for sunday skol
Lptw proper-10 a-yc-ot lesson for sunday skolLptw proper-10 a-yc-ot lesson for sunday skol
Lptw proper-10 a-yc-ot lesson for sunday skol
 
Preparing for examination
Preparing for examinationPreparing for examination
Preparing for examination
 
Magnesium m
Magnesium mMagnesium m
Magnesium m
 
Γεωγράφοι
ΓεωγράφοιΓεωγράφοι
Γεωγράφοι
 
Andaimeparte3ok
Andaimeparte3okAndaimeparte3ok
Andaimeparte3ok
 
Portfolio 2015
Portfolio 2015 Portfolio 2015
Portfolio 2015
 
знайомство з бібліотекою - філією №2 Івано-Франківської МЦБС
знайомство з бібліотекою - філією №2 Івано-Франківської МЦБСзнайомство з бібліотекою - філією №2 Івано-Франківської МЦБС
знайомство з бібліотекою - філією №2 Івано-Франківської МЦБС
 
CV-2015 net
CV-2015 netCV-2015 net
CV-2015 net
 
Portfolio 2015
Portfolio 2015Portfolio 2015
Portfolio 2015
 
APT - BUEIROS
APT - BUEIROSAPT - BUEIROS
APT - BUEIROS
 
Modelagem computacional
Modelagem computacionalModelagem computacional
Modelagem computacional
 
क्रांतीयुग
क्रांतीयुगक्रांतीयुग
क्रांतीयुग
 
Farming 2
Farming 2Farming 2
Farming 2
 
साधी यंत्रे
साधी यंत्रेसाधी यंत्रे
साधी यंत्रे
 
Manual de compra_nrfacil
Manual de compra_nrfacilManual de compra_nrfacil
Manual de compra_nrfacil
 
Fns sst-apt- 27-passagem inferior
Fns sst-apt- 27-passagem inferiorFns sst-apt- 27-passagem inferior
Fns sst-apt- 27-passagem inferior
 
PORTFOLIO 2015 net
PORTFOLIO 2015 netPORTFOLIO 2015 net
PORTFOLIO 2015 net
 

Ähnlich wie RESTing on HTTP

Interactive web. O rly?
Interactive web. O rly?Interactive web. O rly?
Interactive web. O rly?
timbc
 
1 Introduction to PHP Overview This lab walks y.docx
1  Introduction to PHP Overview This lab walks y.docx1  Introduction to PHP Overview This lab walks y.docx
1 Introduction to PHP Overview This lab walks y.docx
honey725342
 

Ähnlich wie RESTing on HTTP (20)

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

Mehr von Maximilian Berghoff

RESTing on HTTP - FrOSCon 10 - 2015-08-23
RESTing on HTTP - FrOSCon 10 - 2015-08-23RESTing on HTTP - FrOSCon 10 - 2015-08-23
RESTing on HTTP - FrOSCon 10 - 2015-08-23
Maximilian Berghoff
 

Mehr von Maximilian Berghoff (20)

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

Kürzlich hochgeladen

在线制作约克大学毕业证(yu毕业证)在读证明认证可查
在线制作约克大学毕业证(yu毕业证)在读证明认证可查在线制作约克大学毕业证(yu毕业证)在读证明认证可查
在线制作约克大学毕业证(yu毕业证)在读证明认证可查
ydyuyu
 
哪里办理美国迈阿密大学毕业证(本硕)umiami在读证明存档可查
哪里办理美国迈阿密大学毕业证(本硕)umiami在读证明存档可查哪里办理美国迈阿密大学毕业证(本硕)umiami在读证明存档可查
哪里办理美国迈阿密大学毕业证(本硕)umiami在读证明存档可查
ydyuyu
 
pdfcoffee.com_business-ethics-q3m7-pdf-free.pdf
pdfcoffee.com_business-ethics-q3m7-pdf-free.pdfpdfcoffee.com_business-ethics-q3m7-pdf-free.pdf
pdfcoffee.com_business-ethics-q3m7-pdf-free.pdf
JOHNBEBONYAP1
 
一比一原版(Curtin毕业证书)科廷大学毕业证原件一模一样
一比一原版(Curtin毕业证书)科廷大学毕业证原件一模一样一比一原版(Curtin毕业证书)科廷大学毕业证原件一模一样
一比一原版(Curtin毕业证书)科廷大学毕业证原件一模一样
ayvbos
 
Russian Call girls in Abu Dhabi 0508644382 Abu Dhabi Call girls
Russian Call girls in Abu Dhabi 0508644382 Abu Dhabi Call girlsRussian Call girls in Abu Dhabi 0508644382 Abu Dhabi Call girls
Russian Call girls in Abu Dhabi 0508644382 Abu Dhabi Call girls
Monica Sydney
 
75539-Cyber Security Challenges PPT.pptx
75539-Cyber Security Challenges PPT.pptx75539-Cyber Security Challenges PPT.pptx
75539-Cyber Security Challenges PPT.pptx
Asmae Rabhi
 
PowerDirector Explination Process...pptx
PowerDirector Explination Process...pptxPowerDirector Explination Process...pptx
PowerDirector Explination Process...pptx
galaxypingy
 

Kürzlich hochgeladen (20)

2nd Solid Symposium: Solid Pods vs Personal Knowledge Graphs
2nd Solid Symposium: Solid Pods vs Personal Knowledge Graphs2nd Solid Symposium: Solid Pods vs Personal Knowledge Graphs
2nd Solid Symposium: Solid Pods vs Personal Knowledge Graphs
 
在线制作约克大学毕业证(yu毕业证)在读证明认证可查
在线制作约克大学毕业证(yu毕业证)在读证明认证可查在线制作约克大学毕业证(yu毕业证)在读证明认证可查
在线制作约克大学毕业证(yu毕业证)在读证明认证可查
 
20240509 QFM015 Engineering Leadership Reading List April 2024.pdf
20240509 QFM015 Engineering Leadership Reading List April 2024.pdf20240509 QFM015 Engineering Leadership Reading List April 2024.pdf
20240509 QFM015 Engineering Leadership Reading List April 2024.pdf
 
哪里办理美国迈阿密大学毕业证(本硕)umiami在读证明存档可查
哪里办理美国迈阿密大学毕业证(本硕)umiami在读证明存档可查哪里办理美国迈阿密大学毕业证(本硕)umiami在读证明存档可查
哪里办理美国迈阿密大学毕业证(本硕)umiami在读证明存档可查
 
pdfcoffee.com_business-ethics-q3m7-pdf-free.pdf
pdfcoffee.com_business-ethics-q3m7-pdf-free.pdfpdfcoffee.com_business-ethics-q3m7-pdf-free.pdf
pdfcoffee.com_business-ethics-q3m7-pdf-free.pdf
 
Nagercoil Escorts Service Girl ^ 9332606886, WhatsApp Anytime Nagercoil
Nagercoil Escorts Service Girl ^ 9332606886, WhatsApp Anytime NagercoilNagercoil Escorts Service Girl ^ 9332606886, WhatsApp Anytime Nagercoil
Nagercoil Escorts Service Girl ^ 9332606886, WhatsApp Anytime Nagercoil
 
一比一原版(Curtin毕业证书)科廷大学毕业证原件一模一样
一比一原版(Curtin毕业证书)科廷大学毕业证原件一模一样一比一原版(Curtin毕业证书)科廷大学毕业证原件一模一样
一比一原版(Curtin毕业证书)科廷大学毕业证原件一模一样
 
20240510 QFM016 Irresponsible AI Reading List April 2024.pdf
20240510 QFM016 Irresponsible AI Reading List April 2024.pdf20240510 QFM016 Irresponsible AI Reading List April 2024.pdf
20240510 QFM016 Irresponsible AI Reading List April 2024.pdf
 
Power point inglese - educazione civica di Nuria Iuzzolino
Power point inglese - educazione civica di Nuria IuzzolinoPower point inglese - educazione civica di Nuria Iuzzolino
Power point inglese - educazione civica di Nuria Iuzzolino
 
Russian Call girls in Abu Dhabi 0508644382 Abu Dhabi Call girls
Russian Call girls in Abu Dhabi 0508644382 Abu Dhabi Call girlsRussian Call girls in Abu Dhabi 0508644382 Abu Dhabi Call girls
Russian Call girls in Abu Dhabi 0508644382 Abu Dhabi Call girls
 
20240508 QFM014 Elixir Reading List April 2024.pdf
20240508 QFM014 Elixir Reading List April 2024.pdf20240508 QFM014 Elixir Reading List April 2024.pdf
20240508 QFM014 Elixir Reading List April 2024.pdf
 
75539-Cyber Security Challenges PPT.pptx
75539-Cyber Security Challenges PPT.pptx75539-Cyber Security Challenges PPT.pptx
75539-Cyber Security Challenges PPT.pptx
 
PowerDirector Explination Process...pptx
PowerDirector Explination Process...pptxPowerDirector Explination Process...pptx
PowerDirector Explination Process...pptx
 
Story Board.pptxrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr
Story Board.pptxrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrStory Board.pptxrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr
Story Board.pptxrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr
 
Best SEO Services Company in Dallas | Best SEO Agency Dallas
Best SEO Services Company in Dallas | Best SEO Agency DallasBest SEO Services Company in Dallas | Best SEO Agency Dallas
Best SEO Services Company in Dallas | Best SEO Agency Dallas
 
best call girls in Hyderabad Finest Escorts Service 📞 9352988975 📞 Available ...
best call girls in Hyderabad Finest Escorts Service 📞 9352988975 📞 Available ...best call girls in Hyderabad Finest Escorts Service 📞 9352988975 📞 Available ...
best call girls in Hyderabad Finest Escorts Service 📞 9352988975 📞 Available ...
 
20240507 QFM013 Machine Intelligence Reading List April 2024.pdf
20240507 QFM013 Machine Intelligence Reading List April 2024.pdf20240507 QFM013 Machine Intelligence Reading List April 2024.pdf
20240507 QFM013 Machine Intelligence Reading List April 2024.pdf
 
Trump Diapers Over Dems t shirts Sweatshirt
Trump Diapers Over Dems t shirts SweatshirtTrump Diapers Over Dems t shirts Sweatshirt
Trump Diapers Over Dems t shirts Sweatshirt
 
Microsoft Azure Arc Customer Deck Microsoft
Microsoft Azure Arc Customer Deck MicrosoftMicrosoft Azure Arc Customer Deck Microsoft
Microsoft Azure Arc Customer Deck Microsoft
 
APNIC Updates presented by Paul Wilson at ARIN 53
APNIC Updates presented by Paul Wilson at ARIN 53APNIC Updates presented by Paul Wilson at ARIN 53
APNIC Updates presented by Paul Wilson at ARIN 53
 

RESTing on HTTP