SlideShare a Scribd company logo
1 of 11
REST
REST, or REpresentational State Transfer, is an architectural style for providing
standards between computer systems on the web, making it easier for systems
to communicate with each other.
We use REST primarily as a way to communicate between computer systems
on the World Wide Web with JSON.
REST vs HTTP
• REST is an architectural style and not the standard.
• HTTP is a protocol to transfer hyper-text.
• Provides a lot of freedom to implement various design best practices.
• Flexibility to use some other application protocol with REST
• GET, POST, PUT, DELETE
HATEOAS
• Hypermedia As The Engine Of Application State
• Provide specific response for a request and hypermedia links to
related endpoints and thus decouple the design
HATEOS Sample
RESTful API
• Works on client-server architecture
• Does not maintain states between two consecutive request.
• Provides flexibility, scalability over distributed system
• Concrete is better than Abstract
URI Formatting
• Resources are Nouns, Not Verbs
• HTTP methods are verbs
• Singular vs Plural
• /getAllUsers
• /updateUser/{userId}
• /updateUserArticle/{articleId}
Error Handling
• Maintain uniformity
• Should include message, status_code, type
Status Codes
• 1XX – Informational
Communicates transfer protocol-level information.
• 2XX – Success
Indicates that the client’s request was accepted successfully.
• 3XX – Redirection
Indicates that the client must take some additional action in order to
complete their request.
• 4XX - Client Error
• 5XX – Server Error
Security
• Some useful resource to secure REST endpoints.
https://www.devglan.com/spring-security/spring-webflux-rest-
authentication
Versioning
• https://api.example.com/v1/authors/2/blogposts/13
Documentation
• Swagger

More Related Content

What's hot

Webservices divya 1
Webservices divya 1Webservices divya 1
Webservices divya 1rajamandava4
 
An Overview of Web Services: SOAP and REST
An Overview of Web Services: SOAP and REST An Overview of Web Services: SOAP and REST
An Overview of Web Services: SOAP and REST Ram Awadh Prasad, PMP
 
Web services for Laymen
Web services for LaymenWeb services for Laymen
Web services for LaymenYukti Kaura
 
Rest webservice ppt
Rest webservice pptRest webservice ppt
Rest webservice pptsinhatanay
 
Understanding SOAP and REST basics and differences
Understanding SOAP and REST basics and differencesUnderstanding SOAP and REST basics and differences
Understanding SOAP and REST basics and differencesBhavendra Chavan
 
Web services automation from sketch
Web services automation from sketchWeb services automation from sketch
Web services automation from sketchIT Weekend
 
10x10 on <link />
10x10 on <link />10x10 on <link />
10x10 on <link />cbatiloiii
 
Learn REST API at ASIT
Learn REST API at ASITLearn REST API at ASIT
Learn REST API at ASITASIT
 
Overview of REST - Raihan Ullah
Overview of REST - Raihan UllahOverview of REST - Raihan Ullah
Overview of REST - Raihan UllahCefalo
 
Efficient Spring Data REST Development
Efficient Spring Data REST DevelopmentEfficient Spring Data REST Development
Efficient Spring Data REST DevelopmentCatalin Tudose
 
Python wsgi protocol
Python wsgi protocolPython wsgi protocol
Python wsgi protocolDivya Ahuja
 
Representational state transfer (rest) architectural style1.1
Representational state transfer (rest) architectural style1.1Representational state transfer (rest) architectural style1.1
Representational state transfer (rest) architectural style1.1Vinod Wilson
 
Web server architecture
Web server architectureWeb server architecture
Web server architectureTewodros K
 
Restoring an ost file from exchange
Restoring an ost file from exchangeRestoring an ost file from exchange
Restoring an ost file from exchangeLeeta Mocus
 
Exchange Conference (Philadelphia) - Exchange 2007 Overview and Management
Exchange Conference (Philadelphia) - Exchange 2007 Overview and ManagementExchange Conference (Philadelphia) - Exchange 2007 Overview and Management
Exchange Conference (Philadelphia) - Exchange 2007 Overview and ManagementHarold Wong
 
53 hui homework2
53 hui homework253 hui homework2
53 hui homework2huis89
 

What's hot (20)

Webservices divya 1
Webservices divya 1Webservices divya 1
Webservices divya 1
 
An Overview of Web Services: SOAP and REST
An Overview of Web Services: SOAP and REST An Overview of Web Services: SOAP and REST
An Overview of Web Services: SOAP and REST
 
Web services for Laymen
Web services for LaymenWeb services for Laymen
Web services for Laymen
 
Rest webservice ppt
Rest webservice pptRest webservice ppt
Rest webservice ppt
 
Understanding SOAP and REST basics and differences
Understanding SOAP and REST basics and differencesUnderstanding SOAP and REST basics and differences
Understanding SOAP and REST basics and differences
 
Web services automation from sketch
Web services automation from sketchWeb services automation from sketch
Web services automation from sketch
 
10x10 on <link />
10x10 on <link />10x10 on <link />
10x10 on <link />
 
Rest
RestRest
Rest
 
Learn REST API at ASIT
Learn REST API at ASITLearn REST API at ASIT
Learn REST API at ASIT
 
Web services
Web servicesWeb services
Web services
 
Overview of REST - Raihan Ullah
Overview of REST - Raihan UllahOverview of REST - Raihan Ullah
Overview of REST - Raihan Ullah
 
Efficient Spring Data REST Development
Efficient Spring Data REST DevelopmentEfficient Spring Data REST Development
Efficient Spring Data REST Development
 
Python wsgi protocol
Python wsgi protocolPython wsgi protocol
Python wsgi protocol
 
Representational state transfer (rest) architectural style1.1
Representational state transfer (rest) architectural style1.1Representational state transfer (rest) architectural style1.1
Representational state transfer (rest) architectural style1.1
 
Web server architecture
Web server architectureWeb server architecture
Web server architecture
 
Web Services in the Real World
Web Services in the Real WorldWeb Services in the Real World
Web Services in the Real World
 
Restoring an ost file from exchange
Restoring an ost file from exchangeRestoring an ost file from exchange
Restoring an ost file from exchange
 
Exchange Conference (Philadelphia) - Exchange 2007 Overview and Management
Exchange Conference (Philadelphia) - Exchange 2007 Overview and ManagementExchange Conference (Philadelphia) - Exchange 2007 Overview and Management
Exchange Conference (Philadelphia) - Exchange 2007 Overview and Management
 
53 hui homework2
53 hui homework253 hui homework2
53 hui homework2
 
Web services
Web services Web services
Web services
 

Similar to Rest Best Practices

REST Introduction.ppt
REST Introduction.pptREST Introduction.ppt
REST Introduction.pptKGSCSEPSGCT
 
unit -4 spring web services like SOA Arch
unit -4 spring web services like SOA Archunit -4 spring web services like SOA Arch
unit -4 spring web services like SOA Archsudharani127782
 
REST & SOAP.pptx
REST & SOAP.pptxREST & SOAP.pptx
REST & SOAP.pptxZawLwinTun2
 
RESTfulll web services
RESTfulll web servicesRESTfulll web services
RESTfulll web servicesJuan Sandoval
 
200211 Fielding Apachecon
200211 Fielding Apachecon200211 Fielding Apachecon
200211 Fielding ApacheconDaniel Parker
 
Restful web services with java
Restful web services with javaRestful web services with java
Restful web services with javaVinay Gopinath
 
Separating REST Facts from Fallacies
Separating REST Facts from FallaciesSeparating REST Facts from Fallacies
Separating REST Facts from FallaciesAlan Dean
 
Research Topics in Machine Hypermedia
Research Topics in Machine HypermediaResearch Topics in Machine Hypermedia
Research Topics in Machine HypermediaMichael Koster
 
REST API Recommendations
REST API RecommendationsREST API Recommendations
REST API RecommendationsJeelani Shaik
 
Connecting to Data from Windows Phone 8
Connecting to Data from Windows Phone 8Connecting to Data from Windows Phone 8
Connecting to Data from Windows Phone 8Woodruff Solutions LLC
 
Introduction to APIs (Application Programming Interface)
Introduction to APIs (Application Programming Interface) Introduction to APIs (Application Programming Interface)
Introduction to APIs (Application Programming Interface) Vibhawa Nirmal
 

Similar to Rest Best Practices (20)

Mini-Training: Let's have a rest
Mini-Training: Let's have a restMini-Training: Let's have a rest
Mini-Training: Let's have a rest
 
REST Introduction.ppt
REST Introduction.pptREST Introduction.ppt
REST Introduction.ppt
 
unit -4 spring web services like SOA Arch
unit -4 spring web services like SOA Archunit -4 spring web services like SOA Arch
unit -4 spring web services like SOA Arch
 
Restful web services
Restful web servicesRestful web services
Restful web services
 
RESTful APIs
RESTful APIsRESTful APIs
RESTful APIs
 
REST & SOAP.pptx
REST & SOAP.pptxREST & SOAP.pptx
REST & SOAP.pptx
 
RESTfulll web services
RESTfulll web servicesRESTfulll web services
RESTfulll web services
 
200211 Fielding Apachecon
200211 Fielding Apachecon200211 Fielding Apachecon
200211 Fielding Apachecon
 
REST & RESTful Web Services
REST & RESTful Web ServicesREST & RESTful Web Services
REST & RESTful Web Services
 
Restful web services with java
Restful web services with javaRestful web services with java
Restful web services with java
 
Separating REST Facts from Fallacies
Separating REST Facts from FallaciesSeparating REST Facts from Fallacies
Separating REST Facts from Fallacies
 
Research Topics in Machine Hypermedia
Research Topics in Machine HypermediaResearch Topics in Machine Hypermedia
Research Topics in Machine Hypermedia
 
Rest APIs Training
Rest APIs TrainingRest APIs Training
Rest APIs Training
 
What is REST?
What is REST?What is REST?
What is REST?
 
Api 101
Api 101Api 101
Api 101
 
REST API Recommendations
REST API RecommendationsREST API Recommendations
REST API Recommendations
 
A REST API (also called a RESTful API or RESTful web API) is an application p...
A REST API (also called a RESTful API or RESTful web API) is an application p...A REST API (also called a RESTful API or RESTful web API) is an application p...
A REST API (also called a RESTful API or RESTful web API) is an application p...
 
RESTful services
RESTful servicesRESTful services
RESTful services
 
Connecting to Data from Windows Phone 8
Connecting to Data from Windows Phone 8Connecting to Data from Windows Phone 8
Connecting to Data from Windows Phone 8
 
Introduction to APIs (Application Programming Interface)
Introduction to APIs (Application Programming Interface) Introduction to APIs (Application Programming Interface)
Introduction to APIs (Application Programming Interface)
 

Recently uploaded

Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxNirmalaLoungPoorunde1
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Krashi Coaching
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxOH TEIK BIN
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
 
MENTAL STATUS EXAMINATION format.docx
MENTAL     STATUS EXAMINATION format.docxMENTAL     STATUS EXAMINATION format.docx
MENTAL STATUS EXAMINATION format.docxPoojaSen20
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformChameera Dedduwage
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docxPoojaSen20
 
Concept of Vouching. B.Com(Hons) /B.Compdf
Concept of Vouching. B.Com(Hons) /B.CompdfConcept of Vouching. B.Com(Hons) /B.Compdf
Concept of Vouching. B.Com(Hons) /B.CompdfUmakantAnnand
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfsanyamsingh5019
 
Class 11 Legal Studies Ch-1 Concept of State .pdf
Class 11 Legal Studies Ch-1 Concept of State .pdfClass 11 Legal Studies Ch-1 Concept of State .pdf
Class 11 Legal Studies Ch-1 Concept of State .pdfakmcokerachita
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTiammrhaywood
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentInMediaRes1
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Sapana Sha
 
Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application ) Sakshi Ghasle
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesFatimaKhan178732
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13Steve Thomason
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationnomboosow
 
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...M56BOOKSTORE PRODUCT/SERVICE
 

Recently uploaded (20)

Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptx
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptx
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
MENTAL STATUS EXAMINATION format.docx
MENTAL     STATUS EXAMINATION format.docxMENTAL     STATUS EXAMINATION format.docx
MENTAL STATUS EXAMINATION format.docx
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docx
 
Staff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSDStaff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSD
 
Concept of Vouching. B.Com(Hons) /B.Compdf
Concept of Vouching. B.Com(Hons) /B.CompdfConcept of Vouching. B.Com(Hons) /B.Compdf
Concept of Vouching. B.Com(Hons) /B.Compdf
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
 
Class 11 Legal Studies Ch-1 Concept of State .pdf
Class 11 Legal Studies Ch-1 Concept of State .pdfClass 11 Legal Studies Ch-1 Concept of State .pdf
Class 11 Legal Studies Ch-1 Concept of State .pdf
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media Component
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
 
Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application )
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and Actinides
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communication
 
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
 

Rest Best Practices

  • 1. REST REST, or REpresentational State Transfer, is an architectural style for providing standards between computer systems on the web, making it easier for systems to communicate with each other. We use REST primarily as a way to communicate between computer systems on the World Wide Web with JSON.
  • 2. REST vs HTTP • REST is an architectural style and not the standard. • HTTP is a protocol to transfer hyper-text. • Provides a lot of freedom to implement various design best practices. • Flexibility to use some other application protocol with REST • GET, POST, PUT, DELETE
  • 3. HATEOAS • Hypermedia As The Engine Of Application State • Provide specific response for a request and hypermedia links to related endpoints and thus decouple the design
  • 5. RESTful API • Works on client-server architecture • Does not maintain states between two consecutive request. • Provides flexibility, scalability over distributed system • Concrete is better than Abstract
  • 6. URI Formatting • Resources are Nouns, Not Verbs • HTTP methods are verbs • Singular vs Plural • /getAllUsers • /updateUser/{userId} • /updateUserArticle/{articleId}
  • 7. Error Handling • Maintain uniformity • Should include message, status_code, type
  • 8. Status Codes • 1XX – Informational Communicates transfer protocol-level information. • 2XX – Success Indicates that the client’s request was accepted successfully. • 3XX – Redirection Indicates that the client must take some additional action in order to complete their request. • 4XX - Client Error • 5XX – Server Error
  • 9. Security • Some useful resource to secure REST endpoints. https://www.devglan.com/spring-security/spring-webflux-rest- authentication

Editor's Notes

  1. GET is meant to perform read a resource. POST is used to create a new resource. PUT is used to update an existing resource. DELETE is for deleting an existing resource.
  2. Here is an example of creating REST endpoints with Spring - https://www.devglan.com/spring-boot/spring-boot-angular-example
  3. https://www.devglan.com/spring-security/exception-handling-in-spring-security