SlideShare ist ein Scribd-Unternehmen logo
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

Weitere ähnliche Inhalte

Was ist angesagt?

Understanding REST
Understanding RESTUnderstanding REST
Understanding REST
Nitin Pande
 
HTTP Request and Response Structure
HTTP Request and Response StructureHTTP Request and Response Structure
HTTP Request and Response Structure
BhagyashreeGajera1
 
Vulnerabilities in modern web applications
Vulnerabilities in modern web applicationsVulnerabilities in modern web applications
Vulnerabilities in modern web applications
Niyas Nazar
 
Brute force attack
Brute force attackBrute force attack
Brute force attack
Jamil Ali Ahmed
 
javaScript.ppt
javaScript.pptjavaScript.ppt
javaScript.ppt
sentayehu
 
Introduction to Web Development
Introduction to Web DevelopmentIntroduction to Web Development
Introduction to Web Development
Parvez Mahbub
 
REST API and CRUD
REST API and CRUDREST API and CRUD
REST API and CRUD
Prem Sanil
 
Brute force-attack presentation
Brute force-attack presentationBrute force-attack presentation
Brute force-attack presentation
Mahmoud Ibra
 
Introduction to Web Technology
Introduction to Web TechnologyIntroduction to Web Technology
Introduction to Web Technology
Aashish Jain
 
Chapter 3 servlet & jsp
Chapter 3 servlet & jspChapter 3 servlet & jsp
Chapter 3 servlet & jsp
Jafar Nesargi
 
Introduction to the Web API
Introduction to the Web APIIntroduction to the Web API
Introduction to the Web API
Brad Genereaux
 
Restful web services ppt
Restful web services pptRestful web services ppt
Restful web services ppt
OECLIB Odisha Electronics Control Library
 
Rest API
Rest APIRest API
Rest API
Rohana K Amarakoon
 
Cross Site Request Forgery
Cross Site Request ForgeryCross Site Request Forgery
Cross Site Request Forgery
Tony Bibbs
 
Java rmi
Java rmiJava rmi
Java rmi
kamal kotecha
 
Introduction to Web Hosting.
Introduction to Web Hosting.Introduction to Web Hosting.
Introduction to Web Hosting.
Cloudbells.com
 
Introduction to HTTP protocol
Introduction to HTTP protocolIntroduction to HTTP protocol
Introduction to HTTP protocol
Aviran Mordo
 
Lecture 1 Introduction to Web Development.pptx
Lecture 1 Introduction to Web Development.pptxLecture 1 Introduction to Web Development.pptx
Lecture 1 Introduction to Web Development.pptx
Kevi20
 
Brute force-attack presentation
Brute force-attack presentationBrute force-attack presentation
Brute force-attack presentation
Mahmoud Ibra
 
Introduction to CSS
Introduction to CSSIntroduction to CSS
Introduction to CSS
Amit Tyagi
 

Was ist angesagt? (20)

Understanding REST
Understanding RESTUnderstanding REST
Understanding REST
 
HTTP Request and Response Structure
HTTP Request and Response StructureHTTP Request and Response Structure
HTTP Request and Response Structure
 
Vulnerabilities in modern web applications
Vulnerabilities in modern web applicationsVulnerabilities in modern web applications
Vulnerabilities in modern web applications
 
Brute force attack
Brute force attackBrute force attack
Brute force attack
 
javaScript.ppt
javaScript.pptjavaScript.ppt
javaScript.ppt
 
Introduction to Web Development
Introduction to Web DevelopmentIntroduction to Web Development
Introduction to Web Development
 
REST API and CRUD
REST API and CRUDREST API and CRUD
REST API and CRUD
 
Brute force-attack presentation
Brute force-attack presentationBrute force-attack presentation
Brute force-attack presentation
 
Introduction to Web Technology
Introduction to Web TechnologyIntroduction to Web Technology
Introduction to Web Technology
 
Chapter 3 servlet & jsp
Chapter 3 servlet & jspChapter 3 servlet & jsp
Chapter 3 servlet & jsp
 
Introduction to the Web API
Introduction to the Web APIIntroduction to the Web API
Introduction to the Web API
 
Restful web services ppt
Restful web services pptRestful web services ppt
Restful web services ppt
 
Rest API
Rest APIRest API
Rest API
 
Cross Site Request Forgery
Cross Site Request ForgeryCross Site Request Forgery
Cross Site Request Forgery
 
Java rmi
Java rmiJava rmi
Java rmi
 
Introduction to Web Hosting.
Introduction to Web Hosting.Introduction to Web Hosting.
Introduction to Web Hosting.
 
Introduction to HTTP protocol
Introduction to HTTP protocolIntroduction to HTTP protocol
Introduction to HTTP protocol
 
Lecture 1 Introduction to Web Development.pptx
Lecture 1 Introduction to Web Development.pptxLecture 1 Introduction to Web Development.pptx
Lecture 1 Introduction to Web Development.pptx
 
Brute force-attack presentation
Brute force-attack presentationBrute force-attack presentation
Brute force-attack presentation
 
Introduction to CSS
Introduction to CSSIntroduction to CSS
Introduction to CSS
 

Ähnlich wie Rest webservice ppt

REST Introduction.ppt
REST Introduction.pptREST Introduction.ppt
REST Introduction.ppt
KGSCSEPSGCT
 
Rest WebAPI with OData
Rest WebAPI with ODataRest WebAPI with OData
Rest WebAPI with OData
Mahek Merchant
 
REST API Recommendations
REST API RecommendationsREST API Recommendations
REST API Recommendations
Jeelani Shaik
 
Rest component demo
Rest component demoRest component demo
Rest component demo
Ramakrishna kapa
 
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
Ram Awadh Prasad, PMP
 
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
Betclic Everest Group Tech Team
 
Overview of java web services
Overview of java web servicesOverview of java web services
Overview of java web services
Todd Benson (I.T. SPECIALIST and I.T. SECURITY)
 
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
Siddharth Sharma
 
RESTful APIs
RESTful APIsRESTful APIs
RESTful APIs
Adi Challa
 
Rest APIs Training
Rest APIs TrainingRest APIs Training
Rest APIs Training
Shekhar Kumar
 
Unit v
Unit v Unit v
Unit v
APARNA P
 
ROA.ppt
ROA.pptROA.ppt
ROA.ppt
KGSCSEPSGCT
 
Rest & RESTful WebServices
Rest & RESTful WebServicesRest & RESTful WebServices
Rest & RESTful WebServices
Prateek Tandon
 
Ch 3: Web Application Technologies
Ch 3: Web Application TechnologiesCh 3: Web Application Technologies
Ch 3: Web Application Technologies
Sam Bowne
 
Ch-1_.ppt
Ch-1_.pptCh-1_.ppt
Ch-1_.ppt
berihunmolla2
 
SCWCD : The web client model
SCWCD : The web client modelSCWCD : The web client model
SCWCD : The web client model
Ben Abdallah Helmi
 
Best Practices in Web Service Design
Best Practices in Web Service DesignBest Practices in Web Service Design
Best Practices in Web Service Design
Lorna Mitchell
 
Restful webservice
Restful webserviceRestful webservice
Restful webservice
Dong Ngoc
 
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
Ben Abdallah Helmi
 

Ähnlich wie 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
 

KĂźrzlich hochgeladen

Project Management Semester Long Project - Acuity
Project Management Semester Long Project - AcuityProject Management Semester Long Project - Acuity
Project Management Semester Long Project - Acuity
jpupo2018
 
Fueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte WebinarFueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte Webinar
Zilliz
 
20240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 202420240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 2024
Matthew Sinclair
 
National Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practicesNational Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practices
Quotidiano Piemontese
 
Taking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdfTaking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdf
ssuserfac0301
 
Main news related to the CCS TSI 2023 (2023/1695)
Main news related to the CCS TSI 2023 (2023/1695)Main news related to the CCS TSI 2023 (2023/1695)
Main news related to the CCS TSI 2023 (2023/1695)
Jakub Marek
 
OpenID AuthZEN Interop Read Out - Authorization
OpenID AuthZEN Interop Read Out - AuthorizationOpenID AuthZEN Interop Read Out - Authorization
OpenID AuthZEN Interop Read Out - Authorization
David Brossard
 
Mariano G Tinti - Decoding SpaceX
Mariano G Tinti - Decoding SpaceXMariano G Tinti - Decoding SpaceX
Mariano G Tinti - Decoding SpaceX
Mariano Tinti
 
Programming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup SlidesProgramming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup Slides
Zilliz
 
GraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracyGraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracy
Tomaz Bratanic
 
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy SurveyTrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc
 
UI5 Controls simplified - UI5con2024 presentation
UI5 Controls simplified - UI5con2024 presentationUI5 Controls simplified - UI5con2024 presentation
UI5 Controls simplified - UI5con2024 presentation
Wouter Lemaire
 
How to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For FlutterHow to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For Flutter
Daiki Mogmet Ito
 
Presentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of GermanyPresentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of Germany
innovationoecd
 
Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024
Jason Packer
 
Monitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdfMonitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdf
Tosin Akinosho
 
Artificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopmentArtificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopment
Octavian Nadolu
 
HCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAUHCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAU
panagenda
 
WeTestAthens: Postman's AI & Automation Techniques
WeTestAthens: Postman's AI & Automation TechniquesWeTestAthens: Postman's AI & Automation Techniques
WeTestAthens: Postman's AI & Automation Techniques
Postman
 
UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6
DianaGray10
 

KĂźrzlich hochgeladen (20)

Project Management Semester Long Project - Acuity
Project Management Semester Long Project - AcuityProject Management Semester Long Project - Acuity
Project Management Semester Long Project - Acuity
 
Fueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte WebinarFueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte Webinar
 
20240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 202420240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 2024
 
National Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practicesNational Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practices
 
Taking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdfTaking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdf
 
Main news related to the CCS TSI 2023 (2023/1695)
Main news related to the CCS TSI 2023 (2023/1695)Main news related to the CCS TSI 2023 (2023/1695)
Main news related to the CCS TSI 2023 (2023/1695)
 
OpenID AuthZEN Interop Read Out - Authorization
OpenID AuthZEN Interop Read Out - AuthorizationOpenID AuthZEN Interop Read Out - Authorization
OpenID AuthZEN Interop Read Out - Authorization
 
Mariano G Tinti - Decoding SpaceX
Mariano G Tinti - Decoding SpaceXMariano G Tinti - Decoding SpaceX
Mariano G Tinti - Decoding SpaceX
 
Programming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup SlidesProgramming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup Slides
 
GraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracyGraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracy
 
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy SurveyTrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy Survey
 
UI5 Controls simplified - UI5con2024 presentation
UI5 Controls simplified - UI5con2024 presentationUI5 Controls simplified - UI5con2024 presentation
UI5 Controls simplified - UI5con2024 presentation
 
How to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For FlutterHow to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For Flutter
 
Presentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of GermanyPresentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of Germany
 
Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024
 
Monitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdfMonitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdf
 
Artificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopmentArtificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopment
 
HCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAUHCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAU
 
WeTestAthens: Postman's AI & Automation Techniques
WeTestAthens: Postman's AI & Automation TechniquesWeTestAthens: Postman's AI & Automation Techniques
WeTestAthens: Postman's AI & Automation Techniques
 
UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6
 

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