SlideShare uma empresa Scribd logo
1 de 21
Baixar para ler offline
 Express.js is a web framework for Node.js. It is a
fast, robust and asynchronous in nature.
 ExpressJS is a web application framework that
provides you with a simple API to build websites,
web apps and back ends.
 Install express framework globally to create web
application using node terminal.
npm install –g express
npm install express --save
npm install –g nodemon
var express = require('express')
var app = express()
app.get('/',function(req,res){
res.send("Hello Govardhan")
});
app.listen(2022)
 Routing is made from the word route. It is used to
determine the specific behavior of an application.
 It specifies how an application responds to a client
request to a particular route, URI or path and a
specific HTTP request method (GET, POST, etc.). It
can handle different types of HTTP requests.
app.method(path, handler)
 MVC is the most popular & useful structure for web application and it
describes as
▪ Model – It can handle the database
▪ View – It can handle the client-side web pages
▪ Controller – It can control the request & response of Model & View
 Error handling in Express is done using middleware.
But this middleware has special properties. The error
handling middleware are defined in the same way as
other middleware functions, except that error-
handling functions must have four arguments instead
of three – err, req, res, next.
 For error handling, we have the next(err) function. A
call to this function skips all middleware and matches
us to the next error handler for that route.
var express = require('express');
var app = express();
app.get('/', function(req, res){
//Create an error and pass it to the next function
var err = new Error();
next(err);
});
//An error handling middleware
app.use(function(err, req, res, next) {
res.status(500);
res.send("Oops, Something went wrong.")
});
app.listen(2022);
 Express uses the Debug module to internally log
information about route matching, middleware
functions, application mode, etc.
 To see all internal logs used in Express, set the
DEBUG environment variable to Express:* when
starting the app −
DEBUG = express:* node index.js
 A template engine enables you to use static template files
in your application. At runtime, the template engine
replaces variables in a template file with actual values, and
transforms the template into an HTML file sent to the
client. This approach makes it easier to design an HTML
page.
 Some popular template engines that work with Express
are Pug, Mustache, and EJS.
npm install pug --save
SimplePug.pug
doctype html
html
head
title=title
body
h1(align=alignment)=myHeading
SimplePug.js
var express = require('express');
var app = express();
app.set('view engine','pug');
app.get('/',function(req,res){
res.render('SimplePug',{
title: "Template Engine",
myHeading: "Pug Template",
alignment: "center"
});
});
app.listen(2022,function(){
console.log("Sever Running");
});
 Process manager is a container for applications that
facilitates deployment, provides high availability, and
enables you to manage the application at runtime.
 It is helpful to –
 Restart the app automatically if it crashes.
 Gain insights into runtime performance and resource
consumption.
 Modify settings dynamically to improve performance.
 Control clustering.
 RESTful web services are basically REST
architecture based web services.
 RESTful web services are light-weight, highly
scalable and maintainable and are very commonly
used to create APIs for web-based applications.
 REST – REpresentational State Transfer.
 It is web standard based architecture and uses HTTP
protocol.
 It revolves around resource where every component
is a resource and a resource is accessed by a common
interface using HTTP methods.
 Four HTTP methods are commonly used in REST
based architecture:
1. GET – Provides a read only access to a resource.
2. POST – Used to create a new resource.
3. DELETE – Used to remove a resource.
4. PUT – Used to update an existing resource or create a
new resource.
 Uniform interface constraint defines the interface
between clients and servers.
 Four principles of uniform interface:
1. Identifying Resources
2. Manipulation of Resources through Representations
3. Self-descriptive messages
4. Hypermedia as the Engine of Application State
 Each resource in REST architecture is identified
by its URI (Uniform Resource Identifier).
 The generic URI syntax as shown below:
<protocol>://<service-name>/<ResourceType>/<ResourceID>
Cont…
1. A trailing forward slash (/) should not be included in URIs
2. Forward slash separator (/) must be used to indicate a hierarchical
relationship
3. Hyphens (-) should be used to improve the readability of URIs
4. Underscores (_) should not be used in URIs
5. Lowercase letters should be preferred in URI paths
6. File extensions should not be included in URIs
7. Should the endpoint name be plural nouns

Mais conteúdo relacionado

Semelhante a ExpressJS and REST API.pptx

Network Device Database Management with REST using Jersey
Network Device Database Management with REST using JerseyNetwork Device Database Management with REST using Jersey
Network Device Database Management with REST using JerseyPayal Jain
 
JAX-RS 2.0 and OData
JAX-RS 2.0 and ODataJAX-RS 2.0 and OData
JAX-RS 2.0 and ODataAnil Allewar
 
Building Killer RESTful APIs with NodeJs
Building Killer RESTful APIs with NodeJsBuilding Killer RESTful APIs with NodeJs
Building Killer RESTful APIs with NodeJsSrdjan Strbanovic
 
Getting started with dotnet core Web APIs
Getting started with dotnet core Web APIsGetting started with dotnet core Web APIs
Getting started with dotnet core Web APIsKnoldus Inc.
 
Weekly Tech Session
Weekly Tech SessionWeekly Tech Session
Weekly Tech SessionPravin Vaja
 
WordCamp Raleigh 2016 - WP API, What is it good for? Absolutely Everything!
WordCamp Raleigh 2016 - WP API, What is it good for? Absolutely Everything!WordCamp Raleigh 2016 - WP API, What is it good for? Absolutely Everything!
WordCamp Raleigh 2016 - WP API, What is it good for? Absolutely Everything!Evan Mullins
 
Node Session - 3
Node Session - 3Node Session - 3
Node Session - 3Bhavin Shah
 
Rest service in mule
Rest service in mule Rest service in mule
Rest service in mule Harish43
 
Beginning MEAN Stack
Beginning MEAN StackBeginning MEAN Stack
Beginning MEAN StackRob Davarnia
 
JAX-RS. Developing RESTful APIs with Java
JAX-RS. Developing RESTful APIs with JavaJAX-RS. Developing RESTful APIs with Java
JAX-RS. Developing RESTful APIs with JavaJerry Kurian
 
Express Generator.pdf
Express Generator.pdfExpress Generator.pdf
Express Generator.pdfBareen Shaikh
 
IRJET- Rest API for E-Commerce Site
IRJET- Rest API for E-Commerce SiteIRJET- Rest API for E-Commerce Site
IRJET- Rest API for E-Commerce SiteIRJET Journal
 
Rest and Sling Resolution
Rest and Sling ResolutionRest and Sling Resolution
Rest and Sling ResolutionDEEPAK KHETAWAT
 

Semelhante a ExpressJS and REST API.pptx (20)

Rest web service
Rest web serviceRest web service
Rest web service
 
Network Device Database Management with REST using Jersey
Network Device Database Management with REST using JerseyNetwork Device Database Management with REST using Jersey
Network Device Database Management with REST using Jersey
 
JAX-RS 2.0 and OData
JAX-RS 2.0 and ODataJAX-RS 2.0 and OData
JAX-RS 2.0 and OData
 
Building Killer RESTful APIs with NodeJs
Building Killer RESTful APIs with NodeJsBuilding Killer RESTful APIs with NodeJs
Building Killer RESTful APIs with NodeJs
 
JavaEE6 my way
JavaEE6 my wayJavaEE6 my way
JavaEE6 my way
 
Getting started with dotnet core Web APIs
Getting started with dotnet core Web APIsGetting started with dotnet core Web APIs
Getting started with dotnet core Web APIs
 
Javascript Basic RESTful
Javascript Basic RESTfulJavascript Basic RESTful
Javascript Basic RESTful
 
Weekly Tech Session
Weekly Tech SessionWeekly Tech Session
Weekly Tech Session
 
WordCamp Raleigh 2016 - WP API, What is it good for? Absolutely Everything!
WordCamp Raleigh 2016 - WP API, What is it good for? Absolutely Everything!WordCamp Raleigh 2016 - WP API, What is it good for? Absolutely Everything!
WordCamp Raleigh 2016 - WP API, What is it good for? Absolutely Everything!
 
Node Session - 3
Node Session - 3Node Session - 3
Node Session - 3
 
Rest service in mule
Rest service in mule Rest service in mule
Rest service in mule
 
Express
ExpressExpress
Express
 
Rest Service In Mule
Rest Service In Mule Rest Service In Mule
Rest Service In Mule
 
Beginning MEAN Stack
Beginning MEAN StackBeginning MEAN Stack
Beginning MEAN Stack
 
JAX-RS. Developing RESTful APIs with Java
JAX-RS. Developing RESTful APIs with JavaJAX-RS. Developing RESTful APIs with Java
JAX-RS. Developing RESTful APIs with Java
 
Express Generator.pdf
Express Generator.pdfExpress Generator.pdf
Express Generator.pdf
 
IRJET- Rest API for E-Commerce Site
IRJET- Rest API for E-Commerce SiteIRJET- Rest API for E-Commerce Site
IRJET- Rest API for E-Commerce Site
 
Rest and Sling Resolution
Rest and Sling ResolutionRest and Sling Resolution
Rest and Sling Resolution
 
Node js crash course session 2
Node js crash course   session 2Node js crash course   session 2
Node js crash course session 2
 
ASP.NET WEB API Training
ASP.NET WEB API TrainingASP.NET WEB API Training
ASP.NET WEB API Training
 

Mais de Govardhan Bhavani (17)

Angular Application Setup.pptx
Angular Application Setup.pptxAngular Application Setup.pptx
Angular Application Setup.pptx
 
Files.pptx
Files.pptxFiles.pptx
Files.pptx
 
Pandas.pptx
Pandas.pptxPandas.pptx
Pandas.pptx
 
NumPy.pptx
NumPy.pptxNumPy.pptx
NumPy.pptx
 
NodeJS.pptx
NodeJS.pptxNodeJS.pptx
NodeJS.pptx
 
Angular.pptx
Angular.pptxAngular.pptx
Angular.pptx
 
JavaScript.pptx
JavaScript.pptxJavaScript.pptx
JavaScript.pptx
 
Maven.pptx
Maven.pptxMaven.pptx
Maven.pptx
 
Configure & Version Control-Git.pptx
Configure & Version Control-Git.pptxConfigure & Version Control-Git.pptx
Configure & Version Control-Git.pptx
 
DevOps.pptx
DevOps.pptxDevOps.pptx
DevOps.pptx
 
Agile XP.pptx
Agile XP.pptxAgile XP.pptx
Agile XP.pptx
 
Ajax
AjaxAjax
Ajax
 
Ruby
RubyRuby
Ruby
 
PHP
PHPPHP
PHP
 
CSS
CSSCSS
CSS
 
Unit 1part-2 forms & frames
Unit 1part-2 forms & framesUnit 1part-2 forms & frames
Unit 1part-2 forms & frames
 
Unit 1 (part-1, basic tags)
Unit 1 (part-1, basic tags)Unit 1 (part-1, basic tags)
Unit 1 (part-1, basic tags)
 

Último

Sulphonamides, mechanisms and their uses
Sulphonamides, mechanisms and their usesSulphonamides, mechanisms and their uses
Sulphonamides, mechanisms and their usesVijayaLaxmi84
 
4.16.24 Poverty and Precarity--Desmond.pptx
4.16.24 Poverty and Precarity--Desmond.pptx4.16.24 Poverty and Precarity--Desmond.pptx
4.16.24 Poverty and Precarity--Desmond.pptxmary850239
 
Reading and Writing Skills 11 quarter 4 melc 1
Reading and Writing Skills 11 quarter 4 melc 1Reading and Writing Skills 11 quarter 4 melc 1
Reading and Writing Skills 11 quarter 4 melc 1GloryAnnCastre1
 
How to Fix XML SyntaxError in Odoo the 17
How to Fix XML SyntaxError in Odoo the 17How to Fix XML SyntaxError in Odoo the 17
How to Fix XML SyntaxError in Odoo the 17Celine George
 
Transaction Management in Database Management System
Transaction Management in Database Management SystemTransaction Management in Database Management System
Transaction Management in Database Management SystemChristalin Nelson
 
Congestive Cardiac Failure..presentation
Congestive Cardiac Failure..presentationCongestive Cardiac Failure..presentation
Congestive Cardiac Failure..presentationdeepaannamalai16
 
Q4-PPT-Music9_Lesson-1-Romantic-Opera.pptx
Q4-PPT-Music9_Lesson-1-Romantic-Opera.pptxQ4-PPT-Music9_Lesson-1-Romantic-Opera.pptx
Q4-PPT-Music9_Lesson-1-Romantic-Opera.pptxlancelewisportillo
 
31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...
31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...
31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...Nguyen Thanh Tu Collection
 
How to Manage Buy 3 Get 1 Free in Odoo 17
How to Manage Buy 3 Get 1 Free in Odoo 17How to Manage Buy 3 Get 1 Free in Odoo 17
How to Manage Buy 3 Get 1 Free in Odoo 17Celine George
 
ICS 2208 Lecture Slide Notes for Topic 6
ICS 2208 Lecture Slide Notes for Topic 6ICS 2208 Lecture Slide Notes for Topic 6
ICS 2208 Lecture Slide Notes for Topic 6Vanessa Camilleri
 
MS4 level being good citizen -imperative- (1) (1).pdf
MS4 level   being good citizen -imperative- (1) (1).pdfMS4 level   being good citizen -imperative- (1) (1).pdf
MS4 level being good citizen -imperative- (1) (1).pdfMr Bounab Samir
 
DIFFERENT BASKETRY IN THE PHILIPPINES PPT.pptx
DIFFERENT BASKETRY IN THE PHILIPPINES PPT.pptxDIFFERENT BASKETRY IN THE PHILIPPINES PPT.pptx
DIFFERENT BASKETRY IN THE PHILIPPINES PPT.pptxMichelleTuguinay1
 
ESP 4-EDITED.pdfmmcncncncmcmmnmnmncnmncmnnjvnnv
ESP 4-EDITED.pdfmmcncncncmcmmnmnmncnmncmnnjvnnvESP 4-EDITED.pdfmmcncncncmcmmnmnmncnmncmnnjvnnv
ESP 4-EDITED.pdfmmcncncncmcmmnmnmncnmncmnnjvnnvRicaMaeCastro1
 
CHEST Proprioceptive neuromuscular facilitation.pptx
CHEST Proprioceptive neuromuscular facilitation.pptxCHEST Proprioceptive neuromuscular facilitation.pptx
CHEST Proprioceptive neuromuscular facilitation.pptxAneriPatwari
 
4.11.24 Poverty and Inequality in America.pptx
4.11.24 Poverty and Inequality in America.pptx4.11.24 Poverty and Inequality in America.pptx
4.11.24 Poverty and Inequality in America.pptxmary850239
 
Unraveling Hypertext_ Analyzing Postmodern Elements in Literature.pptx
Unraveling Hypertext_ Analyzing  Postmodern Elements in  Literature.pptxUnraveling Hypertext_ Analyzing  Postmodern Elements in  Literature.pptx
Unraveling Hypertext_ Analyzing Postmodern Elements in Literature.pptxDhatriParmar
 
How to Make a Duplicate of Your Odoo 17 Database
How to Make a Duplicate of Your Odoo 17 DatabaseHow to Make a Duplicate of Your Odoo 17 Database
How to Make a Duplicate of Your Odoo 17 DatabaseCeline George
 
ICS2208 Lecture6 Notes for SL spaces.pdf
ICS2208 Lecture6 Notes for SL spaces.pdfICS2208 Lecture6 Notes for SL spaces.pdf
ICS2208 Lecture6 Notes for SL spaces.pdfVanessa Camilleri
 
Daily Lesson Plan in Mathematics Quarter 4
Daily Lesson Plan in Mathematics Quarter 4Daily Lesson Plan in Mathematics Quarter 4
Daily Lesson Plan in Mathematics Quarter 4JOYLYNSAMANIEGO
 

Último (20)

Sulphonamides, mechanisms and their uses
Sulphonamides, mechanisms and their usesSulphonamides, mechanisms and their uses
Sulphonamides, mechanisms and their uses
 
4.16.24 Poverty and Precarity--Desmond.pptx
4.16.24 Poverty and Precarity--Desmond.pptx4.16.24 Poverty and Precarity--Desmond.pptx
4.16.24 Poverty and Precarity--Desmond.pptx
 
Reading and Writing Skills 11 quarter 4 melc 1
Reading and Writing Skills 11 quarter 4 melc 1Reading and Writing Skills 11 quarter 4 melc 1
Reading and Writing Skills 11 quarter 4 melc 1
 
How to Fix XML SyntaxError in Odoo the 17
How to Fix XML SyntaxError in Odoo the 17How to Fix XML SyntaxError in Odoo the 17
How to Fix XML SyntaxError in Odoo the 17
 
Transaction Management in Database Management System
Transaction Management in Database Management SystemTransaction Management in Database Management System
Transaction Management in Database Management System
 
Paradigm shift in nursing research by RS MEHTA
Paradigm shift in nursing research by RS MEHTAParadigm shift in nursing research by RS MEHTA
Paradigm shift in nursing research by RS MEHTA
 
Congestive Cardiac Failure..presentation
Congestive Cardiac Failure..presentationCongestive Cardiac Failure..presentation
Congestive Cardiac Failure..presentation
 
Q4-PPT-Music9_Lesson-1-Romantic-Opera.pptx
Q4-PPT-Music9_Lesson-1-Romantic-Opera.pptxQ4-PPT-Music9_Lesson-1-Romantic-Opera.pptx
Q4-PPT-Music9_Lesson-1-Romantic-Opera.pptx
 
31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...
31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...
31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...
 
How to Manage Buy 3 Get 1 Free in Odoo 17
How to Manage Buy 3 Get 1 Free in Odoo 17How to Manage Buy 3 Get 1 Free in Odoo 17
How to Manage Buy 3 Get 1 Free in Odoo 17
 
ICS 2208 Lecture Slide Notes for Topic 6
ICS 2208 Lecture Slide Notes for Topic 6ICS 2208 Lecture Slide Notes for Topic 6
ICS 2208 Lecture Slide Notes for Topic 6
 
MS4 level being good citizen -imperative- (1) (1).pdf
MS4 level   being good citizen -imperative- (1) (1).pdfMS4 level   being good citizen -imperative- (1) (1).pdf
MS4 level being good citizen -imperative- (1) (1).pdf
 
DIFFERENT BASKETRY IN THE PHILIPPINES PPT.pptx
DIFFERENT BASKETRY IN THE PHILIPPINES PPT.pptxDIFFERENT BASKETRY IN THE PHILIPPINES PPT.pptx
DIFFERENT BASKETRY IN THE PHILIPPINES PPT.pptx
 
ESP 4-EDITED.pdfmmcncncncmcmmnmnmncnmncmnnjvnnv
ESP 4-EDITED.pdfmmcncncncmcmmnmnmncnmncmnnjvnnvESP 4-EDITED.pdfmmcncncncmcmmnmnmncnmncmnnjvnnv
ESP 4-EDITED.pdfmmcncncncmcmmnmnmncnmncmnnjvnnv
 
CHEST Proprioceptive neuromuscular facilitation.pptx
CHEST Proprioceptive neuromuscular facilitation.pptxCHEST Proprioceptive neuromuscular facilitation.pptx
CHEST Proprioceptive neuromuscular facilitation.pptx
 
4.11.24 Poverty and Inequality in America.pptx
4.11.24 Poverty and Inequality in America.pptx4.11.24 Poverty and Inequality in America.pptx
4.11.24 Poverty and Inequality in America.pptx
 
Unraveling Hypertext_ Analyzing Postmodern Elements in Literature.pptx
Unraveling Hypertext_ Analyzing  Postmodern Elements in  Literature.pptxUnraveling Hypertext_ Analyzing  Postmodern Elements in  Literature.pptx
Unraveling Hypertext_ Analyzing Postmodern Elements in Literature.pptx
 
How to Make a Duplicate of Your Odoo 17 Database
How to Make a Duplicate of Your Odoo 17 DatabaseHow to Make a Duplicate of Your Odoo 17 Database
How to Make a Duplicate of Your Odoo 17 Database
 
ICS2208 Lecture6 Notes for SL spaces.pdf
ICS2208 Lecture6 Notes for SL spaces.pdfICS2208 Lecture6 Notes for SL spaces.pdf
ICS2208 Lecture6 Notes for SL spaces.pdf
 
Daily Lesson Plan in Mathematics Quarter 4
Daily Lesson Plan in Mathematics Quarter 4Daily Lesson Plan in Mathematics Quarter 4
Daily Lesson Plan in Mathematics Quarter 4
 

ExpressJS and REST API.pptx

  • 1.
  • 2.  Express.js is a web framework for Node.js. It is a fast, robust and asynchronous in nature.  ExpressJS is a web application framework that provides you with a simple API to build websites, web apps and back ends.
  • 3.  Install express framework globally to create web application using node terminal. npm install –g express npm install express --save npm install –g nodemon
  • 4. var express = require('express') var app = express() app.get('/',function(req,res){ res.send("Hello Govardhan") }); app.listen(2022)
  • 5.  Routing is made from the word route. It is used to determine the specific behavior of an application.  It specifies how an application responds to a client request to a particular route, URI or path and a specific HTTP request method (GET, POST, etc.). It can handle different types of HTTP requests. app.method(path, handler)
  • 6.  MVC is the most popular & useful structure for web application and it describes as ▪ Model – It can handle the database ▪ View – It can handle the client-side web pages ▪ Controller – It can control the request & response of Model & View
  • 7.
  • 8.  Error handling in Express is done using middleware. But this middleware has special properties. The error handling middleware are defined in the same way as other middleware functions, except that error- handling functions must have four arguments instead of three – err, req, res, next.  For error handling, we have the next(err) function. A call to this function skips all middleware and matches us to the next error handler for that route.
  • 9. var express = require('express'); var app = express(); app.get('/', function(req, res){ //Create an error and pass it to the next function var err = new Error(); next(err); }); //An error handling middleware app.use(function(err, req, res, next) { res.status(500); res.send("Oops, Something went wrong.") }); app.listen(2022);
  • 10.  Express uses the Debug module to internally log information about route matching, middleware functions, application mode, etc.  To see all internal logs used in Express, set the DEBUG environment variable to Express:* when starting the app − DEBUG = express:* node index.js
  • 11.  A template engine enables you to use static template files in your application. At runtime, the template engine replaces variables in a template file with actual values, and transforms the template into an HTML file sent to the client. This approach makes it easier to design an HTML page.  Some popular template engines that work with Express are Pug, Mustache, and EJS. npm install pug --save
  • 12. SimplePug.pug doctype html html head title=title body h1(align=alignment)=myHeading SimplePug.js var express = require('express'); var app = express(); app.set('view engine','pug'); app.get('/',function(req,res){ res.render('SimplePug',{ title: "Template Engine", myHeading: "Pug Template", alignment: "center" }); }); app.listen(2022,function(){ console.log("Sever Running"); });
  • 13.  Process manager is a container for applications that facilitates deployment, provides high availability, and enables you to manage the application at runtime.  It is helpful to –  Restart the app automatically if it crashes.  Gain insights into runtime performance and resource consumption.  Modify settings dynamically to improve performance.  Control clustering.
  • 14.
  • 15.  RESTful web services are basically REST architecture based web services.  RESTful web services are light-weight, highly scalable and maintainable and are very commonly used to create APIs for web-based applications.
  • 16.  REST – REpresentational State Transfer.  It is web standard based architecture and uses HTTP protocol.  It revolves around resource where every component is a resource and a resource is accessed by a common interface using HTTP methods.
  • 17.  Four HTTP methods are commonly used in REST based architecture: 1. GET – Provides a read only access to a resource. 2. POST – Used to create a new resource. 3. DELETE – Used to remove a resource. 4. PUT – Used to update an existing resource or create a new resource.
  • 18.
  • 19.  Uniform interface constraint defines the interface between clients and servers.  Four principles of uniform interface: 1. Identifying Resources 2. Manipulation of Resources through Representations 3. Self-descriptive messages 4. Hypermedia as the Engine of Application State
  • 20.  Each resource in REST architecture is identified by its URI (Uniform Resource Identifier).  The generic URI syntax as shown below: <protocol>://<service-name>/<ResourceType>/<ResourceID> Cont…
  • 21. 1. A trailing forward slash (/) should not be included in URIs 2. Forward slash separator (/) must be used to indicate a hierarchical relationship 3. Hyphens (-) should be used to improve the readability of URIs 4. Underscores (_) should not be used in URIs 5. Lowercase letters should be preferred in URI paths 6. File extensions should not be included in URIs 7. Should the endpoint name be plural nouns