SlideShare a Scribd company logo
RE presentational  S tate  T ransfer
Think of REST this way –  when a browser gets and displays  the elements which make up an HTML page, it is getting a  representation  of the  current state of that  resource .
What is wrong with XML/RPC and SOAP  ? Roy Fielding feels that using HTTP to piggyback application protocols through firewalls the way XML-RPC and SOAP do is a fundamentally misguided idea.  It defeats the idea of having a firewall  and results in firewall vendors having to detect the piggybacked protocol in order to protect the system.  Since most SOAP applications use HTTP for exactly that purpose, you can see where the conflict between REST and SOAP got started. Fielding feels that if you are going to use HTTP, it should be with HTTP semantics.
Resources and Representations The last important bit is the distinction between a resource and its representations.  A resource is the real thing that is being acted upon with a request.  For example, deleting a file from a folder, adding an entry to a blog, or reading the heart rate of a patient.  The data transmitted to and from the resource is a representation of it.  Sometimes the representation can be faithful, such as in a file copy, and sometimes it's just a description, such as the sound of someone's voice. The end effect is that we never send or receive resources, only their representation.  The format of the representation is determined by the content-type.  And the interaction of the representation on the resource is determined by the verb.
REST Verbs Let’s explore the four basic verbs (GET, PUT, DELETE, POST) to define application behavior
GET The GET verb is  used to read a resource .  An important rule of thumb is that a GET operation is  safe .  That is, it can be done repeatedly without changing visibly the state of the resource.  This property is very important for various reasons.   First, indexing engines use GET to index the contents of a resource.  So it would be bad if indexing a resource also changed it.   Second,  intermediaries, such as proxies, may cache results of a GET operation to accelerate subsequent accesses to the same resource. Let's assume we have an image as a resource at "http://myserver/myphotos/mywedding.img".  We can retrieve this image by doing a GET operation on it: GET http://myserver/myphotos/mywedding.img  Similarly, we can also query a complex resource, such as a blog, to get parts of the data: GET http://myserver/myblog/2006-12-25T11:12:05.001Z/comments?query=author:anonymous  The GET verb is the fundamental read operation for resources.    All data resources support GET, but not all behavioral resources do. While a GET request cannot have side-effects, it can return only parts of the resource.  This means that  GET can act as both a read operation and a query operation .
PUT and DELETE The PUT and DELETE verbs  allow a request to alter the state of a resource atomically .   For example, if we wanted to change the image of our earlier example, we could upload a new one using the same URI and the PUT verb:  PUT http://myserver/myphotos/mywedding.img   This operation would indicate to the server that we want to replace the target resource with the contents of our request. Similarly, if we wanted to delete the image, we could use the DELETE verb: DELETE http://myserver/myphotos/mywedding.img   This operation states we want the server to delete or reset the target resource.   Note that PUT and DELETE apply to the entire resource and not just parts of it.  So, when doing a PUT operation, the entire resource is replaced .  PUT acts on the entire resource!  The same is true for DELETE: DELETE acts on the entire resource! The PUT and DELETE operations  are atomic .   If two PUT operations occur simultaneously, one of them will win and determine the final state of the resource.   The same is true when a PUT and DELETE operation occur simultaneously.  Either the resource's final state is updated or it is deleted, but nothing in between.  In the case of two simultaneous DELETE operations, the order does not matter, because deleting a resource again has no effect.
POST The POST verb can  carry a variety of meanings.   It's the Swiss Army Knife of HTTP verbs.  For some resources, it may be used to alter the internal state.  For others, it's behavior may be that of a remote procedure call ( http://en.wikipedia.org/wiki/Remote_procedure_call ). In the example of our blog, we could add a new blog by using the POST verb: POST http://myserver/myblog  The POST operation is very generic and no specific meaning can be attached to it.  In general, use POST when only a subset of a resource needs to be modified and it cannot be accessed as its own resource; or when the equivalent of a method call must be exposed.
First of all a web service  needs a communication channel . You need to be able to ask something to the service and the web service then needs to respond. In the REST web service you ask something just by typing a url.  In the url you give certain parameters that define which information you want the web service to return to you (just like giving GET variables to a page). If you made the correct web service call, it will respond you with an XML page containing the information you’ve asked. An example: http://www.somecompany.com/webservice/?searchuser=yoursearchstring if the user of the string exists the xml will be something like this: yoursearchstring The web service responds and says, I’ve found a user with that username. You can check the stat=”ok” parameter.  If the web service didn’t found a user with your search string it will respond something like this: stat=”fail”, with the error message “User not found”.  Your only task, as a programmer, is to catch that xml and parse it to usable data. And that’s all there is to it. Yes, it’s as simple as that.  Source --> http://www.bornontheweb.be/2006/03/01/rest-web-service-a-flickr-tutorial/

More Related Content

What's hot

Design Beautiful REST + JSON APIs
Design Beautiful REST + JSON APIsDesign Beautiful REST + JSON APIs
Design Beautiful REST + JSON APIs
Stormpath
 
Restful web services ppt
Restful web services pptRestful web services ppt
An Introduction To REST API
An Introduction To REST APIAn Introduction To REST API
An Introduction To REST API
Aniruddh Bhilvare
 
What is an API?
What is an API?What is an API?
What is an API?
Muhammad Zuhdi
 
Web api
Web apiWeb api
REST API
REST APIREST API
REST API
Tofazzal Ahmed
 
Learn REST in 18 Slides
Learn REST in 18 SlidesLearn REST in 18 Slides
Learn REST in 18 Slides
Suraj Gupta
 
REST & RESTful Web Services
REST & RESTful Web ServicesREST & RESTful Web Services
REST & RESTful Web Services
Halil Burak Cetinkaya
 
Spring Boot and REST API
Spring Boot and REST APISpring Boot and REST API
Spring Boot and REST API
07.pallav
 
Soap vs rest
Soap vs restSoap vs rest
Soap vs rest
Antonio Severien
 
RESTful Web Services
RESTful Web ServicesRESTful Web Services
RESTful Web Services
Christopher Bartling
 
C# ASP.NET WEB API APPLICATION DEVELOPMENT
C# ASP.NET WEB API APPLICATION DEVELOPMENTC# ASP.NET WEB API APPLICATION DEVELOPMENT
C# ASP.NET WEB API APPLICATION DEVELOPMENT
Dr. Awase Khirni Syed
 
ASP.NET Web API
ASP.NET Web APIASP.NET Web API
ASP.NET Web API
habib_786
 
Rest api standards and best practices
Rest api standards and best practicesRest api standards and best practices
Rest api standards and best practices
Ankita Mahajan
 
REST API Design & Development
REST API Design & DevelopmentREST API Design & Development
REST API Design & Development
Ashok Pundit
 
Introduction to the Web API
Introduction to the Web APIIntroduction to the Web API
Introduction to the Web API
Brad Genereaux
 
Soap Vs Rest
Soap Vs RestSoap Vs Rest
Soap Vs Rest
sreekveturi
 
Restful api
Restful apiRestful api
Restful api
Anurag Srivastava
 
REST-API overview / concepts
REST-API overview / conceptsREST-API overview / concepts
REST-API overview / concepts
Patrick Savalle
 
Express js
Express jsExpress js
Express js
Manav Prasad
 

What's hot (20)

Design Beautiful REST + JSON APIs
Design Beautiful REST + JSON APIsDesign Beautiful REST + JSON APIs
Design Beautiful REST + JSON APIs
 
Restful web services ppt
Restful web services pptRestful web services ppt
Restful web services ppt
 
An Introduction To REST API
An Introduction To REST APIAn Introduction To REST API
An Introduction To REST API
 
What is an API?
What is an API?What is an API?
What is an API?
 
Web api
Web apiWeb api
Web api
 
REST API
REST APIREST API
REST API
 
Learn REST in 18 Slides
Learn REST in 18 SlidesLearn REST in 18 Slides
Learn REST in 18 Slides
 
REST & RESTful Web Services
REST & RESTful Web ServicesREST & RESTful Web Services
REST & RESTful Web Services
 
Spring Boot and REST API
Spring Boot and REST APISpring Boot and REST API
Spring Boot and REST API
 
Soap vs rest
Soap vs restSoap vs rest
Soap vs rest
 
RESTful Web Services
RESTful Web ServicesRESTful Web Services
RESTful Web Services
 
C# ASP.NET WEB API APPLICATION DEVELOPMENT
C# ASP.NET WEB API APPLICATION DEVELOPMENTC# ASP.NET WEB API APPLICATION DEVELOPMENT
C# ASP.NET WEB API APPLICATION DEVELOPMENT
 
ASP.NET Web API
ASP.NET Web APIASP.NET Web API
ASP.NET Web API
 
Rest api standards and best practices
Rest api standards and best practicesRest api standards and best practices
Rest api standards and best practices
 
REST API Design & Development
REST API Design & DevelopmentREST API Design & Development
REST API Design & Development
 
Introduction to the Web API
Introduction to the Web APIIntroduction to the Web API
Introduction to the Web API
 
Soap Vs Rest
Soap Vs RestSoap Vs Rest
Soap Vs Rest
 
Restful api
Restful apiRestful api
Restful api
 
REST-API overview / concepts
REST-API overview / conceptsREST-API overview / concepts
REST-API overview / concepts
 
Express js
Express jsExpress js
Express js
 

Similar to Understanding REST

Introduction To REST
Introduction To RESTIntroduction To REST
Introduction To REST
rainynovember12
 
REST library.pptx
REST library.pptxREST library.pptx
REST library.pptx
MSivani
 
ReSTful API Final
ReSTful API FinalReSTful API Final
ReSTful API Final
Claudine Bruyns
 
[2015/2016] The REST architectural style
[2015/2016] The REST architectural style[2015/2016] The REST architectural style
[2015/2016] The REST architectural style
Ivano Malavolta
 
Web Tech Java Servlet Update1
Web Tech   Java Servlet Update1Web Tech   Java Servlet Update1
Web Tech Java Servlet Update1
vikram singh
 
Restful web-services
Restful web-servicesRestful web-services
Restful web-services
rporwal
 
An Introduction To Java Web Technology
An Introduction To Java Web TechnologyAn Introduction To Java Web Technology
An Introduction To Java Web Technology
vikram singh
 
Introduction to Rest Protocol
Introduction to Rest ProtocolIntroduction to Rest Protocol
Introduction to Rest Protocol
Avinash Ketkar
 
Restful web services
Restful web servicesRestful web services
Restful web services
MD Sayem Ahmed
 
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
Jerry Kurian
 
The Rest Architectural Style
The Rest Architectural StyleThe Rest Architectural Style
The Rest Architectural Style
Robert Wilson
 
Salesforce REST API
Salesforce  REST API Salesforce  REST API
Salesforce REST API
Bohdan Dovhań
 
Ellerslie User Group - ReST Presentation
Ellerslie User Group - ReST PresentationEllerslie User Group - ReST Presentation
Ellerslie User Group - ReST Presentation
Alex Henderson
 
What are restful web services?
What are restful web services?What are restful web services?
What are restful web services?
Aparna Sharma
 
ROA.ppt
ROA.pptROA.ppt
ROA.ppt
KGSCSEPSGCT
 
RESTful Services
RESTful ServicesRESTful Services
RESTful Services
Kurt Cagle
 
Lecture 12
Lecture 12Lecture 12
Lecture 12
vishal choudhary
 
Best Practices in Api Design
Best Practices in Api DesignBest Practices in Api Design
Best Practices in Api Design
Muhammad Aamir ...
 
SFDC REST API
SFDC REST APISFDC REST API
SFDC REST API
Bohdan Dovhań
 
Resource-Oriented Web Services
Resource-Oriented Web ServicesResource-Oriented Web Services
Resource-Oriented Web Services
Bradley Holt
 

Similar to Understanding REST (20)

Introduction To REST
Introduction To RESTIntroduction To REST
Introduction To REST
 
REST library.pptx
REST library.pptxREST library.pptx
REST library.pptx
 
ReSTful API Final
ReSTful API FinalReSTful API Final
ReSTful API Final
 
[2015/2016] The REST architectural style
[2015/2016] The REST architectural style[2015/2016] The REST architectural style
[2015/2016] The REST architectural style
 
Web Tech Java Servlet Update1
Web Tech   Java Servlet Update1Web Tech   Java Servlet Update1
Web Tech Java Servlet Update1
 
Restful web-services
Restful web-servicesRestful web-services
Restful web-services
 
An Introduction To Java Web Technology
An Introduction To Java Web TechnologyAn Introduction To Java Web Technology
An Introduction To Java Web Technology
 
Introduction to Rest Protocol
Introduction to Rest ProtocolIntroduction to Rest Protocol
Introduction to Rest Protocol
 
Restful web services
Restful web servicesRestful web services
Restful web services
 
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
 
The Rest Architectural Style
The Rest Architectural StyleThe Rest Architectural Style
The Rest Architectural Style
 
Salesforce REST API
Salesforce  REST API Salesforce  REST API
Salesforce REST API
 
Ellerslie User Group - ReST Presentation
Ellerslie User Group - ReST PresentationEllerslie User Group - ReST Presentation
Ellerslie User Group - ReST Presentation
 
What are restful web services?
What are restful web services?What are restful web services?
What are restful web services?
 
ROA.ppt
ROA.pptROA.ppt
ROA.ppt
 
RESTful Services
RESTful ServicesRESTful Services
RESTful Services
 
Lecture 12
Lecture 12Lecture 12
Lecture 12
 
Best Practices in Api Design
Best Practices in Api DesignBest Practices in Api Design
Best Practices in Api Design
 
SFDC REST API
SFDC REST APISFDC REST API
SFDC REST API
 
Resource-Oriented Web Services
Resource-Oriented Web ServicesResource-Oriented Web Services
Resource-Oriented Web Services
 

Recently uploaded

Patch Tuesday de julio
Patch Tuesday de julioPatch Tuesday de julio
Patch Tuesday de julio
Ivanti
 
(CISOPlatform Summit & SACON 2024) Digital Personal Data Protection Act.pdf
(CISOPlatform Summit & SACON 2024) Digital Personal Data Protection Act.pdf(CISOPlatform Summit & SACON 2024) Digital Personal Data Protection Act.pdf
(CISOPlatform Summit & SACON 2024) Digital Personal Data Protection Act.pdf
Priyanka Aash
 
Types of Weaving loom machine & it's technology
Types of Weaving loom machine & it's technologyTypes of Weaving loom machine & it's technology
Types of Weaving loom machine & it's technology
ldtexsolbl
 
The Role of IoT in Australian Mobile App Development - PDF Guide
The Role of IoT in Australian Mobile App Development - PDF GuideThe Role of IoT in Australian Mobile App Development - PDF Guide
The Role of IoT in Australian Mobile App Development - PDF Guide
Shiv Technolabs
 
Sonkoloniya documentation - ONEprojukti.pdf
Sonkoloniya documentation - ONEprojukti.pdfSonkoloniya documentation - ONEprojukti.pdf
Sonkoloniya documentation - ONEprojukti.pdf
SubhamMandal40
 
Acumatica vs. Sage Intacct _Construction_July (1).pptx
Acumatica vs. Sage Intacct _Construction_July (1).pptxAcumatica vs. Sage Intacct _Construction_July (1).pptx
Acumatica vs. Sage Intacct _Construction_July (1).pptx
BrainSell Technologies
 
(CISOPlatform Summit & SACON 2024) Gen AI & Deepfake In Overall Security.pdf
(CISOPlatform Summit & SACON 2024) Gen AI & Deepfake In Overall Security.pdf(CISOPlatform Summit & SACON 2024) Gen AI & Deepfake In Overall Security.pdf
(CISOPlatform Summit & SACON 2024) Gen AI & Deepfake In Overall Security.pdf
Priyanka Aash
 
What's new in android: jetpack compose 2024
What's new in android: jetpack compose 2024What's new in android: jetpack compose 2024
What's new in android: jetpack compose 2024
Toru Wonyoung Choi
 
Girls Call Churchgate 9910780858 Provide Best And Top Girl Service And No1 in...
Girls Call Churchgate 9910780858 Provide Best And Top Girl Service And No1 in...Girls Call Churchgate 9910780858 Provide Best And Top Girl Service And No1 in...
Girls Call Churchgate 9910780858 Provide Best And Top Girl Service And No1 in...
maigasapphire
 
Introduction-to-the-IAM-Platform-Implementation-Plan.pptx
Introduction-to-the-IAM-Platform-Implementation-Plan.pptxIntroduction-to-the-IAM-Platform-Implementation-Plan.pptx
Introduction-to-the-IAM-Platform-Implementation-Plan.pptx
313mohammedarshad
 
The importance of Quality Assurance for ICT Standardization
The importance of Quality Assurance for ICT StandardizationThe importance of Quality Assurance for ICT Standardization
The importance of Quality Assurance for ICT Standardization
Axel Rennoch
 
Mastering OnlyFans Clone App Development: Key Strategies for Success
Mastering OnlyFans Clone App Development: Key Strategies for SuccessMastering OnlyFans Clone App Development: Key Strategies for Success
Mastering OnlyFans Clone App Development: Key Strategies for Success
David Wilson
 
EuroPython 2024 - Streamlining Testing in a Large Python Codebase
EuroPython 2024 - Streamlining Testing in a Large Python CodebaseEuroPython 2024 - Streamlining Testing in a Large Python Codebase
EuroPython 2024 - Streamlining Testing in a Large Python Codebase
Jimmy Lai
 
Best Practices for Effectively Running dbt in Airflow.pdf
Best Practices for Effectively Running dbt in Airflow.pdfBest Practices for Effectively Running dbt in Airflow.pdf
Best Practices for Effectively Running dbt in Airflow.pdf
Tatiana Al-Chueyr
 
Tailored CRM Software Development for Enhanced Customer Insights
Tailored CRM Software Development for Enhanced Customer InsightsTailored CRM Software Development for Enhanced Customer Insights
Tailored CRM Software Development for Enhanced Customer Insights
SynapseIndia
 
Vertex AI Agent Builder - GDG Alicante - Julio 2024
Vertex AI Agent Builder - GDG Alicante - Julio 2024Vertex AI Agent Builder - GDG Alicante - Julio 2024
Vertex AI Agent Builder - GDG Alicante - Julio 2024
Nicolás Lopéz
 
How to Build a Profitable IoT Product.pptx
How to Build a Profitable IoT Product.pptxHow to Build a Profitable IoT Product.pptx
How to Build a Profitable IoT Product.pptx
Adam Dunkels
 
Premium Girls Call Mumbai 9920725232 Unlimited Short Providing Girls Service ...
Premium Girls Call Mumbai 9920725232 Unlimited Short Providing Girls Service ...Premium Girls Call Mumbai 9920725232 Unlimited Short Providing Girls Service ...
Premium Girls Call Mumbai 9920725232 Unlimited Short Providing Girls Service ...
shanihomely
 
IPLOOK Remote-Sensing Satellite Solution
IPLOOK Remote-Sensing Satellite SolutionIPLOOK Remote-Sensing Satellite Solution
IPLOOK Remote-Sensing Satellite Solution
IPLOOK Networks
 
Integrating Kafka with MuleSoft 4 and usecase
Integrating Kafka with MuleSoft 4 and usecaseIntegrating Kafka with MuleSoft 4 and usecase
Integrating Kafka with MuleSoft 4 and usecase
shyamraj55
 

Recently uploaded (20)

Patch Tuesday de julio
Patch Tuesday de julioPatch Tuesday de julio
Patch Tuesday de julio
 
(CISOPlatform Summit & SACON 2024) Digital Personal Data Protection Act.pdf
(CISOPlatform Summit & SACON 2024) Digital Personal Data Protection Act.pdf(CISOPlatform Summit & SACON 2024) Digital Personal Data Protection Act.pdf
(CISOPlatform Summit & SACON 2024) Digital Personal Data Protection Act.pdf
 
Types of Weaving loom machine & it's technology
Types of Weaving loom machine & it's technologyTypes of Weaving loom machine & it's technology
Types of Weaving loom machine & it's technology
 
The Role of IoT in Australian Mobile App Development - PDF Guide
The Role of IoT in Australian Mobile App Development - PDF GuideThe Role of IoT in Australian Mobile App Development - PDF Guide
The Role of IoT in Australian Mobile App Development - PDF Guide
 
Sonkoloniya documentation - ONEprojukti.pdf
Sonkoloniya documentation - ONEprojukti.pdfSonkoloniya documentation - ONEprojukti.pdf
Sonkoloniya documentation - ONEprojukti.pdf
 
Acumatica vs. Sage Intacct _Construction_July (1).pptx
Acumatica vs. Sage Intacct _Construction_July (1).pptxAcumatica vs. Sage Intacct _Construction_July (1).pptx
Acumatica vs. Sage Intacct _Construction_July (1).pptx
 
(CISOPlatform Summit & SACON 2024) Gen AI & Deepfake In Overall Security.pdf
(CISOPlatform Summit & SACON 2024) Gen AI & Deepfake In Overall Security.pdf(CISOPlatform Summit & SACON 2024) Gen AI & Deepfake In Overall Security.pdf
(CISOPlatform Summit & SACON 2024) Gen AI & Deepfake In Overall Security.pdf
 
What's new in android: jetpack compose 2024
What's new in android: jetpack compose 2024What's new in android: jetpack compose 2024
What's new in android: jetpack compose 2024
 
Girls Call Churchgate 9910780858 Provide Best And Top Girl Service And No1 in...
Girls Call Churchgate 9910780858 Provide Best And Top Girl Service And No1 in...Girls Call Churchgate 9910780858 Provide Best And Top Girl Service And No1 in...
Girls Call Churchgate 9910780858 Provide Best And Top Girl Service And No1 in...
 
Introduction-to-the-IAM-Platform-Implementation-Plan.pptx
Introduction-to-the-IAM-Platform-Implementation-Plan.pptxIntroduction-to-the-IAM-Platform-Implementation-Plan.pptx
Introduction-to-the-IAM-Platform-Implementation-Plan.pptx
 
The importance of Quality Assurance for ICT Standardization
The importance of Quality Assurance for ICT StandardizationThe importance of Quality Assurance for ICT Standardization
The importance of Quality Assurance for ICT Standardization
 
Mastering OnlyFans Clone App Development: Key Strategies for Success
Mastering OnlyFans Clone App Development: Key Strategies for SuccessMastering OnlyFans Clone App Development: Key Strategies for Success
Mastering OnlyFans Clone App Development: Key Strategies for Success
 
EuroPython 2024 - Streamlining Testing in a Large Python Codebase
EuroPython 2024 - Streamlining Testing in a Large Python CodebaseEuroPython 2024 - Streamlining Testing in a Large Python Codebase
EuroPython 2024 - Streamlining Testing in a Large Python Codebase
 
Best Practices for Effectively Running dbt in Airflow.pdf
Best Practices for Effectively Running dbt in Airflow.pdfBest Practices for Effectively Running dbt in Airflow.pdf
Best Practices for Effectively Running dbt in Airflow.pdf
 
Tailored CRM Software Development for Enhanced Customer Insights
Tailored CRM Software Development for Enhanced Customer InsightsTailored CRM Software Development for Enhanced Customer Insights
Tailored CRM Software Development for Enhanced Customer Insights
 
Vertex AI Agent Builder - GDG Alicante - Julio 2024
Vertex AI Agent Builder - GDG Alicante - Julio 2024Vertex AI Agent Builder - GDG Alicante - Julio 2024
Vertex AI Agent Builder - GDG Alicante - Julio 2024
 
How to Build a Profitable IoT Product.pptx
How to Build a Profitable IoT Product.pptxHow to Build a Profitable IoT Product.pptx
How to Build a Profitable IoT Product.pptx
 
Premium Girls Call Mumbai 9920725232 Unlimited Short Providing Girls Service ...
Premium Girls Call Mumbai 9920725232 Unlimited Short Providing Girls Service ...Premium Girls Call Mumbai 9920725232 Unlimited Short Providing Girls Service ...
Premium Girls Call Mumbai 9920725232 Unlimited Short Providing Girls Service ...
 
IPLOOK Remote-Sensing Satellite Solution
IPLOOK Remote-Sensing Satellite SolutionIPLOOK Remote-Sensing Satellite Solution
IPLOOK Remote-Sensing Satellite Solution
 
Integrating Kafka with MuleSoft 4 and usecase
Integrating Kafka with MuleSoft 4 and usecaseIntegrating Kafka with MuleSoft 4 and usecase
Integrating Kafka with MuleSoft 4 and usecase
 

Understanding REST

  • 1. RE presentational S tate T ransfer
  • 2. Think of REST this way – when a browser gets and displays the elements which make up an HTML page, it is getting a representation of the current state of that resource .
  • 3. What is wrong with XML/RPC and SOAP ? Roy Fielding feels that using HTTP to piggyback application protocols through firewalls the way XML-RPC and SOAP do is a fundamentally misguided idea. It defeats the idea of having a firewall and results in firewall vendors having to detect the piggybacked protocol in order to protect the system. Since most SOAP applications use HTTP for exactly that purpose, you can see where the conflict between REST and SOAP got started. Fielding feels that if you are going to use HTTP, it should be with HTTP semantics.
  • 4. Resources and Representations The last important bit is the distinction between a resource and its representations.  A resource is the real thing that is being acted upon with a request.  For example, deleting a file from a folder, adding an entry to a blog, or reading the heart rate of a patient.  The data transmitted to and from the resource is a representation of it.  Sometimes the representation can be faithful, such as in a file copy, and sometimes it's just a description, such as the sound of someone's voice. The end effect is that we never send or receive resources, only their representation.  The format of the representation is determined by the content-type.  And the interaction of the representation on the resource is determined by the verb.
  • 5. REST Verbs Let’s explore the four basic verbs (GET, PUT, DELETE, POST) to define application behavior
  • 6. GET The GET verb is used to read a resource .  An important rule of thumb is that a GET operation is safe .  That is, it can be done repeatedly without changing visibly the state of the resource.  This property is very important for various reasons.  First, indexing engines use GET to index the contents of a resource.  So it would be bad if indexing a resource also changed it.  Second, intermediaries, such as proxies, may cache results of a GET operation to accelerate subsequent accesses to the same resource. Let's assume we have an image as a resource at "http://myserver/myphotos/mywedding.img".  We can retrieve this image by doing a GET operation on it: GET http://myserver/myphotos/mywedding.img Similarly, we can also query a complex resource, such as a blog, to get parts of the data: GET http://myserver/myblog/2006-12-25T11:12:05.001Z/comments?query=author:anonymous The GET verb is the fundamental read operation for resources.   All data resources support GET, but not all behavioral resources do. While a GET request cannot have side-effects, it can return only parts of the resource.  This means that GET can act as both a read operation and a query operation .
  • 7. PUT and DELETE The PUT and DELETE verbs allow a request to alter the state of a resource atomically .  For example, if we wanted to change the image of our earlier example, we could upload a new one using the same URI and the PUT verb: PUT http://myserver/myphotos/mywedding.img This operation would indicate to the server that we want to replace the target resource with the contents of our request. Similarly, if we wanted to delete the image, we could use the DELETE verb: DELETE http://myserver/myphotos/mywedding.img This operation states we want the server to delete or reset the target resource. Note that PUT and DELETE apply to the entire resource and not just parts of it.  So, when doing a PUT operation, the entire resource is replaced .  PUT acts on the entire resource!  The same is true for DELETE: DELETE acts on the entire resource! The PUT and DELETE operations are atomic .  If two PUT operations occur simultaneously, one of them will win and determine the final state of the resource.  The same is true when a PUT and DELETE operation occur simultaneously.  Either the resource's final state is updated or it is deleted, but nothing in between.  In the case of two simultaneous DELETE operations, the order does not matter, because deleting a resource again has no effect.
  • 8. POST The POST verb can carry a variety of meanings.   It's the Swiss Army Knife of HTTP verbs.  For some resources, it may be used to alter the internal state.  For others, it's behavior may be that of a remote procedure call ( http://en.wikipedia.org/wiki/Remote_procedure_call ). In the example of our blog, we could add a new blog by using the POST verb: POST http://myserver/myblog The POST operation is very generic and no specific meaning can be attached to it.  In general, use POST when only a subset of a resource needs to be modified and it cannot be accessed as its own resource; or when the equivalent of a method call must be exposed.
  • 9. First of all a web service needs a communication channel . You need to be able to ask something to the service and the web service then needs to respond. In the REST web service you ask something just by typing a url. In the url you give certain parameters that define which information you want the web service to return to you (just like giving GET variables to a page). If you made the correct web service call, it will respond you with an XML page containing the information you’ve asked. An example: http://www.somecompany.com/webservice/?searchuser=yoursearchstring if the user of the string exists the xml will be something like this: yoursearchstring The web service responds and says, I’ve found a user with that username. You can check the stat=”ok” parameter. If the web service didn’t found a user with your search string it will respond something like this: stat=”fail”, with the error message “User not found”. Your only task, as a programmer, is to catch that xml and parse it to usable data. And that’s all there is to it. Yes, it’s as simple as that. Source --> http://www.bornontheweb.be/2006/03/01/rest-web-service-a-flickr-tutorial/