RESTful Web Services Introduction - Restful web service

To start the learning program, first you need to develop a clear conception about what is meant by RESTful web services. So in the first step, let us proceed to the world of Restful web services and get introduced to it.

What is REST?

The term REST is an abbreviation of REpresentational State Transfer. REST is kind of architecture built on web standards which uses HTTP Protocol for the purpose of data communication. In REST, every component is considered as resource and it revolves around the resources. A resource is always accessed by the help of a common interface which uses HTTP standard methods. REST was introduced for the first time in the year 2000 by Roy Fielding.

REST Server in REST architecture provides access to the resources. REST client, on the other hand accesses and presents all the resources. Every resource in this system is identified by URIs/Global IDs. In REST architecture various representations are used in representing a particular resource such as Text, JSON and XML etc. However, JSON Is identified as the most popular format which is widely used in the field of Web Services.

HTTP Methods

Here is a list of HTTP methods which are commonly used in REST architecture.

  • GET – Provides a read only access to a resource.
  • PUT – Used to create a new resource.
  • DELETE – Used to remove a resource
  • POST – Used to update an existing resource or create a new resource.
  • OPTIONS – Used to get the supported operations on a resource.

RESTful Web Services

A web service is nothing but a collection of open standards and protocols which are used to exchange data between systems or applications. Software applications written in different programming languages and running on different platforms can take help of web services in exchanging data over various computer networks including Internet. This is done in the same way as it is done in the inter-process communication process on a single system. This interoperability or the ability of this system in using and exchanging data between Java and Python or Windows and Linux is possible only for the fact that it uses open standards.

So by this time you have come to understand that RESTful Web Services denotes to a web services which is based on REST Architecture. These types of web services establish the basic theories of REST architecture by using HTTP methods. According to the common rule, every RESTful web service defines a Particular URI or Uniform Resource Identifier. The main feature of this service is to offer resource representation like JSON and also a bunch of HTTP Methods.

Creating Restful Web Service

In this chapter you will learn to create a web service known as User Management with the functionalities mentioned below.

Sr.No.
HTTP Method
URI
Operation
Operation Type
1
GET
/UserService/users
Get list of users
Read Only
2
GET
/UserService/users/1
Get User with Id 1
Read Only
3
PUT
/UserService/users/2
Insert User with Id 2
Idempotent
4
POST
/UserService/users/2
Update User with Id 2
N/A
5
DELETE
/UserService/users/1
Delete User with Id 1
Idempotent
6
OPTIONS
/UserService/users
List the supported operations in web service
Read Only

All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd DMCA.com Protection Status

Restful web service Topics