SlideShare una empresa de Scribd logo
1 de 18
REpresentational State Transfer
(REST)
Tanay Sinha
Agenda
WEB SERVICES SOAP vs REST
ADVANTAGESHTTPS
HTTP Methods
Resource AugPAYLOAD
RESTFUL WEB
SERVICE
A Web Service is can be defined by following ways:
• is a client server application or application component for communication
• method of communication between two devices over network.
• is a collection of standards or protocols for exchanging information between
two devices or application.
About Web Services
• There are mainly two types of web services -
TYPES OF WEB SERVICES
SOAP
• Stands for simple object access
protocol
• SOAP is a protocol
• SOAP define standard to be strictly
followed
• SOAP can’t use REST because it a
protocol
• SOAP define xml format only
SOAP v/s REST
REST
• REST stands for Representational
State Transfer
• REST is a architectural Style
• REST doesn't define to much
standard like SOAP
• REST can use SOAP web services
because it is a concept and can use
any protocol like HTTP, SOAP.
• REST permits different data format
such as Plain text, HTML, XML,
JSON etc.
Restful Web Services
• A web service is a collection of open protocols and standards used for
exchanging data between applications or systems.
• Web services based on REST Architecture are known as RESTful Web
Services
• Rest web services use HTTP methods to implement the concept of REST
architecture. A RESTful web service usually defines a URI (Uniform
Resource Identifier), which is a service that provides resource
representation such as JSON and a set of HTTP Methods.
ADDRESSING
• Addressing refers to locating a resource or multiple resources lying on the
server.
• Each resource in REST architecture is identified by its URI (Uniform
Resource Identifier). A URI is of the following format −
• “<protocol>://<service-name>/<ResourceType>/<ResourceID>”
• Purpose of an URI is to locate a resource(s) on the server hosting the web
service.
HTTP METHOD
The following HTTP methods are most commonly used in a REST based
architecture.
▪ GET − Provides a read only access to a resource.
▪ POST − Used to create a new resource.
▪ DELETE − Used to remove a resource.
▪ PUT − Used to update an existing resource or create a new resource.
GET
• The GET method is used to retrieve information from the given server using
a given URI. Requests using GET should only retrieve data and should have
no other effect on the data.
POST
• the POST request method requests that a web server accept the data
enclosed in the body of the request message, most likely for storing it..
PUT
• Replaces all current representations of the target resource with the
uploaded content.
DELETE
• Removes all current representations of the target resource given by a URI.
STATELESSNESS
• RESTful Web Service should not keep a client state on the server. This
restriction is called Statelessness
• It is the responsibility of the client to pass its context to the server and then the
server can store this context to process the client's further request.
• Consider the following URL −
• “http://localhost:8080/UserManagement/rest/UserService/users/1”
• If you hit the above url using your browser or using a java based client or using
Postman, result will always be the User XML whose Id is 1 because the server
does not store any information about the client
• Display the Result in XML format
<user><id>1</id><name>xyz</name></user>
ADVANTAGE OF RESTFUL WEB
SERVICES
SECURITY
• As RESTful Web Services work with HTTP URL Paths, it is very important to
safeguard a RESTful Web Service in the same manner as a website is
secured.
• Following are the best practices to be adhered to while designing a RESTful
Web Service −
• Session Based Authentication − Use session based authentication to
authenticate a user whenever a request is made to a Web Service method.
• Validate Malformed XML/JSON − Check for well-formed input passed to a
web service method.
• No Sensitive Data in the URL − Never use username, password or session
token in a URL, these values should be passed to Web Service via the POST
method.
ADVANTAGE OF RESTFUL WEB
SERVICES
• The Payload section describes the data the server returns in response to a
request.
• The Payload return the data in JSON , XML or Text.
PAYLOAD
• XML Stands for eXtensible Markup Language.
• XML is a markup language much like HTML.
• XML was designed to store and transport data.
• XML uses more words than necessary
▪ Example of XML –
XML
• JSON Stands for JavaScript Object Notation.
• JSON is a syntax for Storing and exchanging data.
• JSON files are more human readable than XML.
• Example of JSON format-
JSON
Thank you
Thank You
Thankyou
GenX Info Technologies Pvt. Ltd.
411, 4th Floor, Bestech Cyber Park
National Highway-8
Gurgaon, Haryana, INDIA
www.gen-xt.com, sales@gen-xt.com
+91-124-2656001, +91-9810402267

Más contenido relacionado

La actualidad más candente (20)

Introduction to HTML5
Introduction to HTML5Introduction to HTML5
Introduction to HTML5
 
Introduction to Html5
Introduction to Html5Introduction to Html5
Introduction to Html5
 
Web Application Development using PHP and MySQL
Web Application Development using PHP and MySQLWeb Application Development using PHP and MySQL
Web Application Development using PHP and MySQL
 
Soap Vs Rest
Soap Vs RestSoap Vs Rest
Soap Vs Rest
 
Web ,app and db server presentation
Web ,app and db server presentationWeb ,app and db server presentation
Web ,app and db server presentation
 
Web server
Web serverWeb server
Web server
 
Client and server side scripting
Client and server side scriptingClient and server side scripting
Client and server side scripting
 
Express js
Express jsExpress js
Express js
 
Rest presentation
Rest  presentationRest  presentation
Rest presentation
 
Xml parsers
Xml parsersXml parsers
Xml parsers
 
Web Development with HTML5, CSS3 & JavaScript
Web Development with HTML5, CSS3 & JavaScriptWeb Development with HTML5, CSS3 & JavaScript
Web Development with HTML5, CSS3 & JavaScript
 
Web api
Web apiWeb api
Web api
 
Asynchronous JavaScript & XML (AJAX)
Asynchronous JavaScript & XML (AJAX)Asynchronous JavaScript & XML (AJAX)
Asynchronous JavaScript & XML (AJAX)
 
HTTP request and response
HTTP request and responseHTTP request and response
HTTP request and response
 
RESTful Web API
RESTful Web APIRESTful Web API
RESTful Web API
 
Introduction to the Web API
Introduction to the Web APIIntroduction to the Web API
Introduction to the Web API
 
Restful Web Services
Restful Web ServicesRestful Web Services
Restful Web Services
 
Spring Security 5
Spring Security 5Spring Security 5
Spring Security 5
 
Java Server Pages
Java Server PagesJava Server Pages
Java Server Pages
 
Server side scripting
Server side scriptingServer side scripting
Server side scripting
 

Similar a Rest webservice ppt

Similar a Rest webservice ppt (20)

REST Introduction.ppt
REST Introduction.pptREST Introduction.ppt
REST Introduction.ppt
 
Rest WebAPI with OData
Rest WebAPI with ODataRest WebAPI with OData
Rest WebAPI with OData
 
REST API Recommendations
REST API RecommendationsREST API Recommendations
REST API Recommendations
 
Rest component demo
Rest component demoRest component demo
Rest component demo
 
Rest
Rest Rest
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
An Overview of Web Services: SOAP and REST
 
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
 
Overview of java web services
Overview of java web servicesOverview of java web services
Overview of java web services
 
API Testing Using REST Assured with TestNG
API Testing Using REST Assured with TestNGAPI Testing Using REST Assured with TestNG
API Testing Using REST Assured with TestNG
 
RESTful APIs
RESTful APIsRESTful APIs
RESTful APIs
 
Rest APIs Training
Rest APIs TrainingRest APIs Training
Rest APIs Training
 
Unit v
Unit v Unit v
Unit v
 
ROA.ppt
ROA.pptROA.ppt
ROA.ppt
 
Rest & RESTful WebServices
Rest & RESTful WebServicesRest & RESTful WebServices
Rest & RESTful WebServices
 
Ch 3: Web Application Technologies
Ch 3: Web Application TechnologiesCh 3: Web Application Technologies
Ch 3: Web Application Technologies
 
Ch-1_.ppt
Ch-1_.pptCh-1_.ppt
Ch-1_.ppt
 
SCWCD : The web client model
SCWCD : The web client modelSCWCD : The web client model
SCWCD : The web client model
 
Best Practices in Web Service Design
Best Practices in Web Service DesignBest Practices in Web Service Design
Best Practices in Web Service Design
 
Restful webservice
Restful webserviceRestful webservice
Restful webservice
 
SCWCD : The web client model : CHAP : 1
SCWCD  : The web client model : CHAP : 1SCWCD  : The web client model : CHAP : 1
SCWCD : The web client model : CHAP : 1
 

Último

Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Victor Rentea
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...apidays
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...Zilliz
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfOrbitshub
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Angeliki Cooney
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...apidays
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAndrey Devyatkin
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...apidays
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesrafiqahmad00786416
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingEdi Saputra
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsNanddeep Nachan
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Orbitshub
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistandanishmna97
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxRustici Software
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 

Último (20)

Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 

Rest webservice ppt

  • 2. Agenda WEB SERVICES SOAP vs REST ADVANTAGESHTTPS HTTP Methods Resource AugPAYLOAD RESTFUL WEB SERVICE
  • 3. A Web Service is can be defined by following ways: • is a client server application or application component for communication • method of communication between two devices over network. • is a collection of standards or protocols for exchanging information between two devices or application. About Web Services
  • 4. • There are mainly two types of web services - TYPES OF WEB SERVICES
  • 5. SOAP • Stands for simple object access protocol • SOAP is a protocol • SOAP define standard to be strictly followed • SOAP can’t use REST because it a protocol • SOAP define xml format only SOAP v/s REST REST • REST stands for Representational State Transfer • REST is a architectural Style • REST doesn't define to much standard like SOAP • REST can use SOAP web services because it is a concept and can use any protocol like HTTP, SOAP. • REST permits different data format such as Plain text, HTML, XML, JSON etc.
  • 6. Restful Web Services • A web service is a collection of open protocols and standards used for exchanging data between applications or systems. • Web services based on REST Architecture are known as RESTful Web Services • Rest web services use HTTP methods to implement the concept of REST architecture. A RESTful web service usually defines a URI (Uniform Resource Identifier), which is a service that provides resource representation such as JSON and a set of HTTP Methods.
  • 7. ADDRESSING • Addressing refers to locating a resource or multiple resources lying on the server. • Each resource in REST architecture is identified by its URI (Uniform Resource Identifier). A URI is of the following format − • “<protocol>://<service-name>/<ResourceType>/<ResourceID>” • Purpose of an URI is to locate a resource(s) on the server hosting the web service.
  • 8. HTTP METHOD The following HTTP methods are most commonly used in a REST based architecture. ▪ GET − Provides a read only access to a resource. ▪ POST − Used to create a new resource. ▪ DELETE − Used to remove a resource. ▪ PUT − Used to update an existing resource or create a new resource.
  • 9. GET • The GET method is used to retrieve information from the given server using a given URI. Requests using GET should only retrieve data and should have no other effect on the data.
  • 10. POST • the POST request method requests that a web server accept the data enclosed in the body of the request message, most likely for storing it..
  • 11. PUT • Replaces all current representations of the target resource with the uploaded content.
  • 12. DELETE • Removes all current representations of the target resource given by a URI.
  • 13. STATELESSNESS • RESTful Web Service should not keep a client state on the server. This restriction is called Statelessness • It is the responsibility of the client to pass its context to the server and then the server can store this context to process the client's further request. • Consider the following URL − • “http://localhost:8080/UserManagement/rest/UserService/users/1” • If you hit the above url using your browser or using a java based client or using Postman, result will always be the User XML whose Id is 1 because the server does not store any information about the client • Display the Result in XML format <user><id>1</id><name>xyz</name></user> ADVANTAGE OF RESTFUL WEB SERVICES
  • 14. SECURITY • As RESTful Web Services work with HTTP URL Paths, it is very important to safeguard a RESTful Web Service in the same manner as a website is secured. • Following are the best practices to be adhered to while designing a RESTful Web Service − • Session Based Authentication − Use session based authentication to authenticate a user whenever a request is made to a Web Service method. • Validate Malformed XML/JSON − Check for well-formed input passed to a web service method. • No Sensitive Data in the URL − Never use username, password or session token in a URL, these values should be passed to Web Service via the POST method. ADVANTAGE OF RESTFUL WEB SERVICES
  • 15. • The Payload section describes the data the server returns in response to a request. • The Payload return the data in JSON , XML or Text. PAYLOAD
  • 16. • XML Stands for eXtensible Markup Language. • XML is a markup language much like HTML. • XML was designed to store and transport data. • XML uses more words than necessary ▪ Example of XML – XML
  • 17. • JSON Stands for JavaScript Object Notation. • JSON is a syntax for Storing and exchanging data. • JSON files are more human readable than XML. • Example of JSON format- JSON
  • 18. Thank you Thank You Thankyou GenX Info Technologies Pvt. Ltd. 411, 4th Floor, Bestech Cyber Park National Highway-8 Gurgaon, Haryana, INDIA www.gen-xt.com, sales@gen-xt.com +91-124-2656001, +91-9810402267