SlideShare une entreprise Scribd logo
1  sur  14
Télécharger pour lire hors ligne
The perfect REST
Solution
Gabriele Mittica - @gabrielemittica
What is REST?
APICONF 2017- Gabriele Mittica
APICONF 2017- Gabriele Mittica
REST
Uniform
Interface
Stateless
Cacheable
Client
Server
Layered
Code on
Demand
REST HTTP
APICONF 2017- Gabriele Mittica
A REQUEST is a set of
Header and Body with a
specific VERB (action)
against an URI (resource)
Header
Body
Verb
on Uri
REQUEST
HTTP VERB
▪ POST: creation
▪ PUT: update
▪ GET: retrieve
▪ DELETE: cancellation
▪ POST+PUT+GET+DELETE = CRUD
▪ PATCH (optional): partial update
APICONF 2017- Gabriele Mittica
A RESPONSE is a set of
headers and body that returns a
specific status code to the client
Header
Body
Status
RESPONSE
APICONF 2017- Gabriele Mittica
APICONF 2017- Gabriele Mittica
Create the perfect url
▪ POST http://www.example.com/customers
▪ GET http://www.example.com/customers/33245
▪ POST http://www.example.com/customers/33245/orders
APICONF 2017 – Gabriele Mittica
Don’t be an artist!
Don’t do that:
▪ GET
http://api.example.com/services?op=update_customer&i
d=12345&format=json
▪ PUT http://api.example.com/customers/12345/update
APICONF 2017 – Gabriele Mittica
Use headers and body in the right way
RIGHT
[
{…},
{…},
{…},
{…}
]
//pagination in header
WRONG
{
‘’pagination’’: { ‘’from’’: 0, ‘’to’’: 10},
‘’data’’: [
{…},
{…},
{…}
]
}
APICONF 2017- Gabriele Mittica
In few words
▪ Work on resources
▪ Use headers, body and query params in the right way
▪ Find the best auth method for your needs
▪ Design layered APIs
APICONF 2017- Gabriele Mittica
Be simply REST
Thanks for Listening

Contenu connexe

Tendances

Documentation-driven development for Python web APIs v2
Documentation-driven development for Python web APIs v2Documentation-driven development for Python web APIs v2
Documentation-driven development for Python web APIs v2
José Haro Peralta
 

Tendances (20)

Making the Difficult, Simple(r)
Making the Difficult, Simple(r)Making the Difficult, Simple(r)
Making the Difficult, Simple(r)
 
Making the Difficult, Simple(r)
Making the Difficult, Simple(r)Making the Difficult, Simple(r)
Making the Difficult, Simple(r)
 
Chernivtsi Magento Meetup&Contribution day. Miniailo.I.
Chernivtsi Magento Meetup&Contribution day. Miniailo.I. Chernivtsi Magento Meetup&Contribution day. Miniailo.I.
Chernivtsi Magento Meetup&Contribution day. Miniailo.I.
 
API SDK Development – Lessons Learned
API SDK Development – Lessons LearnedAPI SDK Development – Lessons Learned
API SDK Development – Lessons Learned
 
Bulletproofing Your APIs: Why Users’ Feedback Matters
Bulletproofing Your APIs: Why Users’ Feedback MattersBulletproofing Your APIs: Why Users’ Feedback Matters
Bulletproofing Your APIs: Why Users’ Feedback Matters
 
ITCamp 2018 - Gunnar Peipman - Deep dive to C# 7
ITCamp 2018 - Gunnar Peipman - Deep dive to C# 7ITCamp 2018 - Gunnar Peipman - Deep dive to C# 7
ITCamp 2018 - Gunnar Peipman - Deep dive to C# 7
 
SilverStripe ♥︎ Mautic
SilverStripe ♥︎ MauticSilverStripe ♥︎ Mautic
SilverStripe ♥︎ Mautic
 
Documentation-driven development for Python web APIs v2
Documentation-driven development for Python web APIs v2Documentation-driven development for Python web APIs v2
Documentation-driven development for Python web APIs v2
 
Lean architecture TDC 2013 at Porto Alegre
Lean architecture TDC 2013 at Porto AlegreLean architecture TDC 2013 at Porto Alegre
Lean architecture TDC 2013 at Porto Alegre
 
Contract testing TestCon 2019
Contract testing TestCon 2019Contract testing TestCon 2019
Contract testing TestCon 2019
 
Sitecore media framework wtih Brightcove - Part 2
Sitecore media framework wtih Brightcove - Part 2Sitecore media framework wtih Brightcove - Part 2
Sitecore media framework wtih Brightcove - Part 2
 
Advancing Your API Strategy in an Infrastructure World
Advancing Your API Strategy in an Infrastructure WorldAdvancing Your API Strategy in an Infrastructure World
Advancing Your API Strategy in an Infrastructure World
 
How to sell SilverStripe in the enterprise and public sector markets - Stripe...
How to sell SilverStripe in the enterprise and public sector markets - Stripe...How to sell SilverStripe in the enterprise and public sector markets - Stripe...
How to sell SilverStripe in the enterprise and public sector markets - Stripe...
 
Multi Source Inventory (MSI) in Magento 2
Multi Source Inventory (MSI) in Magento 2 Multi Source Inventory (MSI) in Magento 2
Multi Source Inventory (MSI) in Magento 2
 
{Re}designing a Developer Portal
{Re}designing a Developer Portal{Re}designing a Developer Portal
{Re}designing a Developer Portal
 
Winning Federal Business: The Open Source Way
Winning Federal Business: The Open Source WayWinning Federal Business: The Open Source Way
Winning Federal Business: The Open Source Way
 
Gerrit Code Review multi-site
Gerrit Code Review multi-siteGerrit Code Review multi-site
Gerrit Code Review multi-site
 
.NET Fest 2018. Vagif Abilov. Akka + F# = Akkling
.NET Fest 2018. Vagif Abilov. Akka + F# = Akkling.NET Fest 2018. Vagif Abilov. Akka + F# = Akkling
.NET Fest 2018. Vagif Abilov. Akka + F# = Akkling
 
Forge - DevCon 2016: Integrate & extend your construction ecosystem with BI...
  Forge - DevCon 2016: Integrate & extend your construction ecosystem with BI...  Forge - DevCon 2016: Integrate & extend your construction ecosystem with BI...
Forge - DevCon 2016: Integrate & extend your construction ecosystem with BI...
 
PHP CE 2018 - Building Symfony application with Ports and Adapters approach a...
PHP CE 2018 - Building Symfony application with Ports and Adapters approach a...PHP CE 2018 - Building Symfony application with Ports and Adapters approach a...
PHP CE 2018 - Building Symfony application with Ports and Adapters approach a...
 

Similaire à Apiconf - The perfect REST solution

Princípios básicos e oAuth 2.0 - MeliDevConf 2013 - SP
Princípios básicos e oAuth 2.0 - MeliDevConf 2013 - SPPrincípios básicos e oAuth 2.0 - MeliDevConf 2013 - SP
Princípios básicos e oAuth 2.0 - MeliDevConf 2013 - SP
melidevelopers
 

Similaire à Apiconf - The perfect REST solution (20)

Rest api code completion for javascript - dotjs 2015
Rest api code completion for javascript - dotjs 2015Rest api code completion for javascript - dotjs 2015
Rest api code completion for javascript - dotjs 2015
 
Best Practices for Architecting a Pragmatic Web API.
Best Practices for Architecting a Pragmatic Web API.Best Practices for Architecting a Pragmatic Web API.
Best Practices for Architecting a Pragmatic Web API.
 
SQLAnywhere 16.0 and Odata
SQLAnywhere 16.0 and OdataSQLAnywhere 16.0 and Odata
SQLAnywhere 16.0 and Odata
 
Web Api vs MVC
Web Api vs MVCWeb Api vs MVC
Web Api vs MVC
 
JNation: REST APIs to GraphQL with Express and Apollo
JNation: REST APIs to GraphQL with Express and ApolloJNation: REST APIs to GraphQL with Express and Apollo
JNation: REST APIs to GraphQL with Express and Apollo
 
BEST REST in OpenStack
BEST REST in OpenStackBEST REST in OpenStack
BEST REST in OpenStack
 
Bringing JAMStack to the Enterprise
Bringing JAMStack to the EnterpriseBringing JAMStack to the Enterprise
Bringing JAMStack to the Enterprise
 
APIdays Singapore 2019 - SDKs and Code Samples - The Cornerstone of API Devel...
APIdays Singapore 2019 - SDKs and Code Samples - The Cornerstone of API Devel...APIdays Singapore 2019 - SDKs and Code Samples - The Cornerstone of API Devel...
APIdays Singapore 2019 - SDKs and Code Samples - The Cornerstone of API Devel...
 
Search engine optimization for symfony developers
Search engine optimization for symfony developersSearch engine optimization for symfony developers
Search engine optimization for symfony developers
 
Power BI for Developers @ SQLSaturday #420 (Paris)
Power BI for Developers @ SQLSaturday #420 (Paris)Power BI for Developers @ SQLSaturday #420 (Paris)
Power BI for Developers @ SQLSaturday #420 (Paris)
 
Salesforce Developer Workshop for GDF Suez Hackathon
Salesforce Developer Workshop for GDF Suez HackathonSalesforce Developer Workshop for GDF Suez Hackathon
Salesforce Developer Workshop for GDF Suez Hackathon
 
Serverless Finland Meetup 10.5.2015: Serverless Framework and Serverless Arch...
Serverless Finland Meetup 10.5.2015: Serverless Framework and Serverless Arch...Serverless Finland Meetup 10.5.2015: Serverless Framework and Serverless Arch...
Serverless Finland Meetup 10.5.2015: Serverless Framework and Serverless Arch...
 
O365 Saturday - Deepdive SharePoint Client Side Rendering
O365 Saturday - Deepdive SharePoint Client Side RenderingO365 Saturday - Deepdive SharePoint Client Side Rendering
O365 Saturday - Deepdive SharePoint Client Side Rendering
 
The 7 Deadly Sins of API Design
The 7 Deadly Sins of API DesignThe 7 Deadly Sins of API Design
The 7 Deadly Sins of API Design
 
Princípios básicos e oAuth 2.0 - MeliDevConf 2013 - SP
Princípios básicos e oAuth 2.0 - MeliDevConf 2013 - SPPrincípios básicos e oAuth 2.0 - MeliDevConf 2013 - SP
Princípios básicos e oAuth 2.0 - MeliDevConf 2013 - SP
 
SharePoint 2013 REST APIs
SharePoint 2013 REST APIsSharePoint 2013 REST APIs
SharePoint 2013 REST APIs
 
Front End Development for Back End Java Developers - Dublin JUG 2019
Front End Development for Back End Java Developers - Dublin JUG 2019Front End Development for Back End Java Developers - Dublin JUG 2019
Front End Development for Back End Java Developers - Dublin JUG 2019
 
API designing with WSO2 API Manager
API designing with WSO2 API ManagerAPI designing with WSO2 API Manager
API designing with WSO2 API Manager
 
Building Beautiful REST APIs with ASP.NET Core
Building Beautiful REST APIs with ASP.NET CoreBuilding Beautiful REST APIs with ASP.NET Core
Building Beautiful REST APIs with ASP.NET Core
 
GraphQL Munich Meetup #1 - How We Use GraphQL At Commercetools
GraphQL Munich Meetup #1 - How We Use GraphQL At CommercetoolsGraphQL Munich Meetup #1 - How We Use GraphQL At Commercetools
GraphQL Munich Meetup #1 - How We Use GraphQL At Commercetools
 

Plus de Corley S.r.l.

Plus de Corley S.r.l. (20)

Aws rekognition - riconoscimento facciale
Aws rekognition  - riconoscimento faccialeAws rekognition  - riconoscimento facciale
Aws rekognition - riconoscimento facciale
 
AWSome day 2018 - scalability and cost optimization with container services
AWSome day 2018 - scalability and cost optimization with container servicesAWSome day 2018 - scalability and cost optimization with container services
AWSome day 2018 - scalability and cost optimization with container services
 
AWSome day 2018 - API serverless with aws
AWSome day 2018  - API serverless with awsAWSome day 2018  - API serverless with aws
AWSome day 2018 - API serverless with aws
 
AWSome day 2018 - database in cloud
AWSome day 2018 -  database in cloudAWSome day 2018 -  database in cloud
AWSome day 2018 - database in cloud
 
Trace your micro-services oriented application with Zipkin and OpenTracing
Trace your micro-services oriented application with Zipkin and OpenTracing Trace your micro-services oriented application with Zipkin and OpenTracing
Trace your micro-services oriented application with Zipkin and OpenTracing
 
Authentication and authorization in res tful infrastructures
Authentication and authorization in res tful infrastructuresAuthentication and authorization in res tful infrastructures
Authentication and authorization in res tful infrastructures
 
Flexibility and scalability of costs in serverless infrastructures
Flexibility and scalability of costs in serverless infrastructuresFlexibility and scalability of costs in serverless infrastructures
Flexibility and scalability of costs in serverless infrastructures
 
CloudConf2017 - Deploy, Scale & Coordinate a microservice oriented application
CloudConf2017 - Deploy, Scale & Coordinate a microservice oriented applicationCloudConf2017 - Deploy, Scale & Coordinate a microservice oriented application
CloudConf2017 - Deploy, Scale & Coordinate a microservice oriented application
 
React vs Angular2
React vs Angular2React vs Angular2
React vs Angular2
 
A single language for backend and frontend from AngularJS to cloud with Clau...
A single language for backend and frontend  from AngularJS to cloud with Clau...A single language for backend and frontend  from AngularJS to cloud with Clau...
A single language for backend and frontend from AngularJS to cloud with Clau...
 
AngularJS: Service, factory & provider
AngularJS: Service, factory & providerAngularJS: Service, factory & provider
AngularJS: Service, factory & provider
 
The advantage of developing with TypeScript
The advantage of developing with TypeScript The advantage of developing with TypeScript
The advantage of developing with TypeScript
 
Angular coding: from project management to web and mobile deploy
Angular coding: from project management to web and mobile deployAngular coding: from project management to web and mobile deploy
Angular coding: from project management to web and mobile deploy
 
Corley cloud angular in cloud
Corley cloud   angular in cloudCorley cloud   angular in cloud
Corley cloud angular in cloud
 
Measure your app internals with InfluxDB and Symfony2
Measure your app internals with InfluxDB and Symfony2Measure your app internals with InfluxDB and Symfony2
Measure your app internals with InfluxDB and Symfony2
 
Read Twitter Stream and Tweet back pictures with Raspberry Pi & AWS Lambda
Read Twitter Stream and Tweet back pictures with Raspberry Pi & AWS LambdaRead Twitter Stream and Tweet back pictures with Raspberry Pi & AWS Lambda
Read Twitter Stream and Tweet back pictures with Raspberry Pi & AWS Lambda
 
Deploy and Scale your PHP App with AWS ElasticBeanstalk and Docker- PHPTour L...
Deploy and Scale your PHP App with AWS ElasticBeanstalk and Docker- PHPTour L...Deploy and Scale your PHP App with AWS ElasticBeanstalk and Docker- PHPTour L...
Deploy and Scale your PHP App with AWS ElasticBeanstalk and Docker- PHPTour L...
 
Middleware PHP - A simple micro-framework
Middleware PHP - A simple micro-frameworkMiddleware PHP - A simple micro-framework
Middleware PHP - A simple micro-framework
 
From Chef to Saltstack on Cloud Providers - Incontro DevOps 2015
From Chef to Saltstack on Cloud Providers - Incontro DevOps 2015From Chef to Saltstack on Cloud Providers - Incontro DevOps 2015
From Chef to Saltstack on Cloud Providers - Incontro DevOps 2015
 
Cloud Conf 2015 - Develop and Deploy IOT Applications
Cloud Conf 2015 - Develop and Deploy IOT ApplicationsCloud Conf 2015 - Develop and Deploy IOT Applications
Cloud Conf 2015 - Develop and Deploy IOT Applications
 

Dernier

一比一原版(Flinders毕业证书)弗林德斯大学毕业证原件一模一样
一比一原版(Flinders毕业证书)弗林德斯大学毕业证原件一模一样一比一原版(Flinders毕业证书)弗林德斯大学毕业证原件一模一样
一比一原版(Flinders毕业证书)弗林德斯大学毕业证原件一模一样
ayvbos
 
call girls in Anand Vihar (delhi) call me [🔝9953056974🔝] escort service 24X7
call girls in Anand Vihar (delhi) call me [🔝9953056974🔝] escort service 24X7call girls in Anand Vihar (delhi) call me [🔝9953056974🔝] escort service 24X7
call girls in Anand Vihar (delhi) call me [🔝9953056974🔝] escort service 24X7
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
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
 
Indian Escort in Abu DHabi 0508644382 Abu Dhabi Escorts
Indian Escort in Abu DHabi 0508644382 Abu Dhabi EscortsIndian Escort in Abu DHabi 0508644382 Abu Dhabi Escorts
Indian Escort in Abu DHabi 0508644382 Abu Dhabi Escorts
Monica Sydney
 
一比一原版(Curtin毕业证书)科廷大学毕业证原件一模一样
一比一原版(Curtin毕业证书)科廷大学毕业证原件一模一样一比一原版(Curtin毕业证书)科廷大学毕业证原件一模一样
一比一原版(Curtin毕业证书)科廷大学毕业证原件一模一样
ayvbos
 
哪里办理美国迈阿密大学毕业证(本硕)umiami在读证明存档可查
哪里办理美国迈阿密大学毕业证(本硕)umiami在读证明存档可查哪里办理美国迈阿密大学毕业证(本硕)umiami在读证明存档可查
哪里办理美国迈阿密大学毕业证(本硕)umiami在读证明存档可查
ydyuyu
 

Dernier (20)

一比一原版(Flinders毕业证书)弗林德斯大学毕业证原件一模一样
一比一原版(Flinders毕业证书)弗林德斯大学毕业证原件一模一样一比一原版(Flinders毕业证书)弗林德斯大学毕业证原件一模一样
一比一原版(Flinders毕业证书)弗林德斯大学毕业证原件一模一样
 
call girls in Anand Vihar (delhi) call me [🔝9953056974🔝] escort service 24X7
call girls in Anand Vihar (delhi) call me [🔝9953056974🔝] escort service 24X7call girls in Anand Vihar (delhi) call me [🔝9953056974🔝] escort service 24X7
call girls in Anand Vihar (delhi) call me [🔝9953056974🔝] escort service 24X7
 
Tadepalligudem Escorts Service Girl ^ 9332606886, WhatsApp Anytime Tadepallig...
Tadepalligudem Escorts Service Girl ^ 9332606886, WhatsApp Anytime Tadepallig...Tadepalligudem Escorts Service Girl ^ 9332606886, WhatsApp Anytime Tadepallig...
Tadepalligudem Escorts Service Girl ^ 9332606886, WhatsApp Anytime Tadepallig...
 
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
 
Mira Road Housewife Call Girls 07506202331, Nalasopara Call Girls
Mira Road Housewife Call Girls 07506202331, Nalasopara Call GirlsMira Road Housewife Call Girls 07506202331, Nalasopara Call Girls
Mira Road Housewife Call Girls 07506202331, Nalasopara Call Girls
 
Call girls Service in Ajman 0505086370 Ajman call girls
Call girls Service in Ajman 0505086370 Ajman call girlsCall girls Service in Ajman 0505086370 Ajman call girls
Call girls Service in Ajman 0505086370 Ajman call girls
 
"Boost Your Digital Presence: Partner with a Leading SEO Agency"
"Boost Your Digital Presence: Partner with a Leading SEO Agency""Boost Your Digital Presence: Partner with a Leading SEO Agency"
"Boost Your Digital Presence: Partner with a Leading SEO Agency"
 
Indian Escort in Abu DHabi 0508644382 Abu Dhabi Escorts
Indian Escort in Abu DHabi 0508644382 Abu Dhabi EscortsIndian Escort in Abu DHabi 0508644382 Abu Dhabi Escorts
Indian Escort in Abu DHabi 0508644382 Abu Dhabi Escorts
 
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
 
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 ...
 
Research Assignment - NIST SP800 [172 A] - Presentation.pptx
Research Assignment - NIST SP800 [172 A] - Presentation.pptxResearch Assignment - NIST SP800 [172 A] - Presentation.pptx
Research Assignment - NIST SP800 [172 A] - Presentation.pptx
 
Leading-edge AI Image Generators of 2024
Leading-edge AI Image Generators of 2024Leading-edge AI Image Generators of 2024
Leading-edge AI Image Generators of 2024
 
APNIC Policy Roundup, presented by Sunny Chendi at the 5th ICANN APAC-TWNIC E...
APNIC Policy Roundup, presented by Sunny Chendi at the 5th ICANN APAC-TWNIC E...APNIC Policy Roundup, presented by Sunny Chendi at the 5th ICANN APAC-TWNIC E...
APNIC Policy Roundup, presented by Sunny Chendi at the 5th ICANN APAC-TWNIC E...
 
一比一原版(Curtin毕业证书)科廷大学毕业证原件一模一样
一比一原版(Curtin毕业证书)科廷大学毕业证原件一模一样一比一原版(Curtin毕业证书)科廷大学毕业证原件一模一样
一比一原版(Curtin毕业证书)科廷大学毕业证原件一模一样
 
Sensual Call Girls in Tarn Taran Sahib { 9332606886 } VVIP NISHA Call Girls N...
Sensual Call Girls in Tarn Taran Sahib { 9332606886 } VVIP NISHA Call Girls N...Sensual Call Girls in Tarn Taran Sahib { 9332606886 } VVIP NISHA Call Girls N...
Sensual Call Girls in Tarn Taran Sahib { 9332606886 } VVIP NISHA Call Girls N...
 
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
 
Ballia Escorts Service Girl ^ 9332606886, WhatsApp Anytime Ballia
Ballia Escorts Service Girl ^ 9332606886, WhatsApp Anytime BalliaBallia Escorts Service Girl ^ 9332606886, WhatsApp Anytime Ballia
Ballia Escorts Service Girl ^ 9332606886, WhatsApp Anytime Ballia
 
Real Men Wear Diapers T Shirts sweatshirt
Real Men Wear Diapers T Shirts sweatshirtReal Men Wear Diapers T Shirts sweatshirt
Real Men Wear Diapers T Shirts sweatshirt
 
哪里办理美国迈阿密大学毕业证(本硕)umiami在读证明存档可查
哪里办理美国迈阿密大学毕业证(本硕)umiami在读证明存档可查哪里办理美国迈阿密大学毕业证(本硕)umiami在读证明存档可查
哪里办理美国迈阿密大学毕业证(本硕)umiami在读证明存档可查
 
South Bopal [ (Call Girls) in Ahmedabad ₹7.5k Pick Up & Drop With Cash Paymen...
South Bopal [ (Call Girls) in Ahmedabad ₹7.5k Pick Up & Drop With Cash Paymen...South Bopal [ (Call Girls) in Ahmedabad ₹7.5k Pick Up & Drop With Cash Paymen...
South Bopal [ (Call Girls) in Ahmedabad ₹7.5k Pick Up & Drop With Cash Paymen...
 

Apiconf - The perfect REST solution

  • 1. The perfect REST Solution Gabriele Mittica - @gabrielemittica
  • 2. What is REST? APICONF 2017- Gabriele Mittica
  • 3. APICONF 2017- Gabriele Mittica REST Uniform Interface Stateless Cacheable Client Server Layered Code on Demand
  • 4. REST HTTP APICONF 2017- Gabriele Mittica
  • 5. A REQUEST is a set of Header and Body with a specific VERB (action) against an URI (resource) Header Body Verb on Uri REQUEST
  • 6. HTTP VERB ▪ POST: creation ▪ PUT: update ▪ GET: retrieve ▪ DELETE: cancellation ▪ POST+PUT+GET+DELETE = CRUD ▪ PATCH (optional): partial update APICONF 2017- Gabriele Mittica
  • 7. A RESPONSE is a set of headers and body that returns a specific status code to the client Header Body Status RESPONSE
  • 10. Create the perfect url ▪ POST http://www.example.com/customers ▪ GET http://www.example.com/customers/33245 ▪ POST http://www.example.com/customers/33245/orders APICONF 2017 – Gabriele Mittica
  • 11. Don’t be an artist! Don’t do that: ▪ GET http://api.example.com/services?op=update_customer&i d=12345&format=json ▪ PUT http://api.example.com/customers/12345/update APICONF 2017 – Gabriele Mittica
  • 12. Use headers and body in the right way RIGHT [ {…}, {…}, {…}, {…} ] //pagination in header WRONG { ‘’pagination’’: { ‘’from’’: 0, ‘’to’’: 10}, ‘’data’’: [ {…}, {…}, {…} ] } APICONF 2017- Gabriele Mittica
  • 13. In few words ▪ Work on resources ▪ Use headers, body and query params in the right way ▪ Find the best auth method for your needs ▪ Design layered APIs APICONF 2017- Gabriele Mittica
  • 14. Be simply REST Thanks for Listening