Friday 19 January 2018

Restful Web Service - Quick Introduction




Introduction

REST (Representational State Transfer) architecture uses HTTP protocol for data communication.
REST is introduced by Roy Fielding in 2000.

RESTful web services are resources on the web and you are allowed to perform certain actions (HTTP Methods) over it.

Resource in REST is identified by URI’s and representation of state is in the form of XML, JSON
etc.
 

Resource in REST can be anything like Text file, HTML Page, Images, Video or dynamic business
data.


Key elements
1. Resource
2. Request Verbs (GET, POST, PUT & DELETE)
3. Request Header & Body
4. Response Header & Body
5. Response Status Code


Characteristics
1. Client Server architecture
2. Stateless (In case of maintaining the client interaction extra information needs to be
send) [Independent Question Answer]
3. Cache


Commonly used HTTP Methods
1. GET
2. POST
3. PUT
4. DELETE
5. OPTIONS


Address format 
<protocol>://<service_name>/<resource_type>/<resource_id>
 
1. Use plural nouns e.g. customers
2. Instead of “ ” use “_” or “-” for big names
3. Use lower case letters
4. Maintain the backward compatibility i.e. when new version is releases use the response
code 300 for redirect

No comments:

Post a Comment

Spring Boot JPA

Spring Boot JPA  In 5 Simple Steps Integrate PostgreSQL Database | Tuorial - 4 Hello Friends, Welcome to Spring Boot JPA tutorial...