SlideShare a Scribd company logo
What are Restful Web
Services?
Introduction
Restful Web Services is a lightweight, manageable and scalable service
based on the REST architecture. Restful Web Service exposes your
application’s API in a secure, uniform, and stateless manner to the
calling client.
Many use Restful architecture to create web-based APIs as I created for
a project, it is a Restful based News API that enables users to fetch and
download worldwide news data. Newsdata.io is the platform that I
am talking about, and you can check out the website and register to get
a free news API key.
The calling customer can perform predefined operations using the
Restful service. The underlying protocol for REST is HTTP.REST
stands for REpresentational State Transfer.
Key elements of REST
REST web services have come a long way since their inception. In
2002, the Web Consortium published the definition of WSDL and
SOAP web services. This formed the standard for implementing web
services.
In 2004, the Web Consortium also published the definition of an
additional standard called RESTful. Over the past two years, this
standard has become very popular. And it’s used by many of the
world’s most popular websites, including Facebook and Twitter.
REST is a means of accessing resources located in a particular
environment. For example, you might have a server that could host
important documents, pictures, or videos. These are all examples of
resources.
If a client, such as a web browser, needs any of these resources, it
should send a request to the server to access these resources. REST
services now define a way to access these resources.
The key elements of a RESTful implementation are as follows:
Resources
The first key element is the resource itself. Let assume that a web
application on a server has records of several employees.
Request Verbs
These describe what you want to do with the resource. A browser
issues a GET verb to indicate to the endpoint that it wants to get the
data. However, there are many other verbs available including POST,
PUT, and DELETE.
Request Headers
These are additional instructions sent with the request. These might
define the type of response required or the authorization details.
Request Body
Data is sent with the request. Data is normally sent in the request when
a POST request is sent to REST web services. In a POST call, the client
is actually telling REST web services that it wants to add a resource to
the server. Then the body of the request would have the details of the
resource that is to be added to the server.
Response Body
This is the main body of the response.
Response Status codes
These codes are the general codes that are returned along with the
response from the webserver. An example is code 200 which is
normally returned if there is no error when returning a response to the
client.
The following actions would have their respective meanings.
Suppose we have a RESTful web service defined in the location. When
the client makes a request to this web service, it can specify any of the
normal HTTP verbs of GET, POST, DELETE, and PUT. arrive If the
respective verbs have been sent by the client.
POST — Create a REST API resource.
GET — Retrieve information about the REST API resource.
PUT — Update a REST API resource.
DELETE — Delete a REST API resource or related component.
Why Restful
Restful mostly came into popularity due to the following reasons:
1. Heterogeneous languages and environments
This is one of the fundamental reasons which is the same we have also
seen for SOAP.
Allows web applications based on various programming languages to
communicate with each other.
Using Restful services, these web applications can reside in different
environments, some can be on Windows, others on Linux.
But in the end, no matter what the environment, the end result should
always be the same where they should be able to talk to each other.
Relying on web services provides this flexibility for applications built
on various programming languages and platforms to communicate
with each other.
The image below shows an example of a web application that should
communicate with other applications such as Facebook, Twitter, and
Google.
Now if a client app were to work with sites like Facebook, Twitter, etc.,
it would likely know what language Facebook, Google, and Twitter are
built on, as well as what platform they are built on.
Based on this we can write our web application interface code, but it
could turn out to be a nightmare.
Facebook, Twitter, and Google exhibit their functionality in the form of
Restful Web Services. This allows any client application to call these
web services through REST.
2. The event of Devices
Nowadays everything has to work on mobile devices, be it mobile
devices, laptops, or even car systems. Can you imagine the amount of
effort that goes into trying to code apps on these devices to
communicate with normal web apps? Again, Restful APIs can make
this job easier because, as mentioned in point n. 1, you don’t really
need to know what the underlying layer of the device is.
3. Finally is the event of the Cloud
Everything moves to the cloud. Applications are slowly moving to
cloud-based systems like Azure or Amazon. Azure and Amazon provide
many APIs based on the Restful architecture.
Consequently, applications must now be developed in such a way as to
be made compatible with the Cloud. Therefore, since all cloud-based
architectures work on the REST principle, it makes more sense for web
services to be programmed on the REST service-based architecture to
get the most out of cloud-based services.
Restful Architecture
An application or architecture considered RESTful or REST-style has
the following characteristics
1. State and functionality are divided into distributed resources
This means that each resource must be accessible through the normal
HTTP commands of GET, POST, PUT or DELETE. So if someone
wants to get a file from a server, they need to be able to send the GET
request and get the file. If they want to put a file on the server, they
must be able to send the POST or PUT request, and finally, if they want
to delete a file from the server, they can send the DELETE request.
2. The architecture is client/server, stateless, layered, and supports
caching
Client-server is the typical architecture where the server can be the
webserver hosting the application and the client can be as simple as the
web browser.
Stateless means that the state of the application is not maintained in
REST. For example, if you delete a resource from a server using the
DELETE command, you cannot expect the deletion information to be
passed on to the next request.
To ensure that the resource is deleted, the GET request must be sent.
The GET request is used to first get all the resources on the server.
After that, you need to check if the resource has been deleted
successfully.
RESTFul Principles and Constraints
The REST architecture is based on certain characteristics which are
developed below. Any RESTful web service must meet the following
characteristics to be called RESTful. These features are also referred to
as design principles that should be followed when using RESTful-based
services.
1. RESTFul Client-Server
This is the fundamental requirement of a REST-based architecture.
This means that the server will have a RESTful web service that will
provide the requested functionality to the client. The client sends a
request to the web service on the server. The server would either reject
the request or comply and provide an adequate response to the client.
2. Stateless
The concept of a stateless state means that it is up to the client to
ensure that all requested information is provided to the server. This is
necessary for the server to correctly process the response. The server
should not keep any information between client requests. This is a very
simple, independent question-and-answer sequence.
The client asks a question, the server responds appropriately. The
customer will ask another question. The server will not remember the
previous question and answer scenario and will have to answer the new
question independently.
3. Cache
The concept of caching is to help with the stateless problem described
in the last point. Since each server-client request is independent in
nature, sometimes the client may request the same request from the
server again. This even if it was already required in the past. This
request will go to the server and the server will give a response.
This increases the traffic on the network. Caching is a concept
implemented on the client to store requests that have already been sent
to the server. So if the same request is given by the client, instead of
going to the server, it would go to the cache and get the requested
information. This saves the amount of round-trip network traffic from
the client to the server.
4. Layered System
The concept of a layered system is that any additional layer such as a
middleware layer can be inserted between the client and the actual
server hosting the RESTFul web service (the middleware layer is where
all the business logic is created.
This could be an extra service created that the client could interact with
before calling the web service.). But the introduction of this layer must
be transparent so as not to disturb the interaction between the client
and the server.
5. Interface/Uniform Contract
This is the technique behind how RESTful web services work. RESTful
basically works on the HTTP web layer and uses the following key
verbs to work with the resources on the
POST — To create a resource on the
GET — To retrieve a resource from the
PUT — To change the state of a resource or to update
DELETE — To delete or delete a resource from the server

More Related Content

Similar to What are restful web services? (20)

PDF
Rest API Interview Questions PDF By ScholarHat
Scholarhat
 
PPTX
RESTful services
Pedram Bashiri
 
PPTX
REST & RESTful Web Service
Hoan Vu Tran
 
PDF
Creating Restful Web Services with restish
Grig Gheorghiu
 
PPT
ROA.ppt
KGSCSEPSGCT
 
PPTX
Mini-Training: Let's have a rest
Betclic Everest Group Tech Team
 
PPTX
Restful webservice
Dong Ngoc
 
PPTX
Rest surekha
Surekha Achanta
 
PDF
Rest
Ivano Malavolta
 
PDF
RESTful applications: The why and how by Maikel Mardjan
Jexia
 
PDF
Ijirsm ashok-kumar-ps-compulsiveness-of-res tful-web-services
IJIR JOURNALS IJIRUSA
 
PDF
Rest Introduction (Chris Jimenez)
PiXeL16
 
PPTX
Introduction to Web Services
Jeffrey Anderson
 
PPTX
REST in short
Akshay Ballarpure
 
PPTX
REST and RESTful Services
Damian T. Gordon
 
PPTX
RESTful APIs in .NET
Greg Sohl
 
PPTX
Rest APIs Training
Shekhar Kumar
 
PPSX
Restful web services rule financial
Rule_Financial
 
PPTX
RESTful Web Services @AnkaraPHP meetup
Fatih Karatana
 
PPTX
Web Service
Ashwani kumar
 
Rest API Interview Questions PDF By ScholarHat
Scholarhat
 
RESTful services
Pedram Bashiri
 
REST & RESTful Web Service
Hoan Vu Tran
 
Creating Restful Web Services with restish
Grig Gheorghiu
 
ROA.ppt
KGSCSEPSGCT
 
Mini-Training: Let's have a rest
Betclic Everest Group Tech Team
 
Restful webservice
Dong Ngoc
 
Rest surekha
Surekha Achanta
 
RESTful applications: The why and how by Maikel Mardjan
Jexia
 
Ijirsm ashok-kumar-ps-compulsiveness-of-res tful-web-services
IJIR JOURNALS IJIRUSA
 
Rest Introduction (Chris Jimenez)
PiXeL16
 
Introduction to Web Services
Jeffrey Anderson
 
REST in short
Akshay Ballarpure
 
REST and RESTful Services
Damian T. Gordon
 
RESTful APIs in .NET
Greg Sohl
 
Rest APIs Training
Shekhar Kumar
 
Restful web services rule financial
Rule_Financial
 
RESTful Web Services @AnkaraPHP meetup
Fatih Karatana
 
Web Service
Ashwani kumar
 

More from Aparna Sharma (20)

PDF
Versioning Best Practices for API Architecture.pdf
Aparna Sharma
 
PDF
Versioning Best Practices for API Architecture.pdf
Aparna Sharma
 
PDF
Modern REST API design principles and rules.pdf
Aparna Sharma
 
PDF
Modern REST API design principles and rules.pdf
Aparna Sharma
 
PDF
Competitive intelligence with Newsdata.io news API.pdf
Aparna Sharma
 
PDF
What is the difference between web scraping and api
Aparna Sharma
 
PDF
Top 15 news apis in the market in 2022 for you
Aparna Sharma
 
PDF
What are the different types of web scraping approaches
Aparna Sharma
 
PDF
Top 11 API testing tools for 2022
Aparna Sharma
 
PDF
Top 11 api testing tools for 2022
Aparna Sharma
 
PDF
Top api testing tools in 2022
Aparna Sharma
 
PDF
Best practices and advantages of REST APIs
Aparna Sharma
 
PDF
Is web scraping legal or not?
Aparna Sharma
 
PDF
Top 17 web scraping tools for data extraction in 2022
Aparna Sharma
 
PDF
Future of saas in 2022 presentation
Aparna Sharma
 
PDF
Future of saas in 2022
Aparna Sharma
 
PDF
10 best platforms to find free datasets
Aparna Sharma
 
PDF
Top 13 web scraping tools in 2022
Aparna Sharma
 
PDF
What is API test automation
Aparna Sharma
 
PDF
What is the difference between an api and web services
Aparna Sharma
 
Versioning Best Practices for API Architecture.pdf
Aparna Sharma
 
Versioning Best Practices for API Architecture.pdf
Aparna Sharma
 
Modern REST API design principles and rules.pdf
Aparna Sharma
 
Modern REST API design principles and rules.pdf
Aparna Sharma
 
Competitive intelligence with Newsdata.io news API.pdf
Aparna Sharma
 
What is the difference between web scraping and api
Aparna Sharma
 
Top 15 news apis in the market in 2022 for you
Aparna Sharma
 
What are the different types of web scraping approaches
Aparna Sharma
 
Top 11 API testing tools for 2022
Aparna Sharma
 
Top 11 api testing tools for 2022
Aparna Sharma
 
Top api testing tools in 2022
Aparna Sharma
 
Best practices and advantages of REST APIs
Aparna Sharma
 
Is web scraping legal or not?
Aparna Sharma
 
Top 17 web scraping tools for data extraction in 2022
Aparna Sharma
 
Future of saas in 2022 presentation
Aparna Sharma
 
Future of saas in 2022
Aparna Sharma
 
10 best platforms to find free datasets
Aparna Sharma
 
Top 13 web scraping tools in 2022
Aparna Sharma
 
What is API test automation
Aparna Sharma
 
What is the difference between an api and web services
Aparna Sharma
 
Ad

Recently uploaded (20)

PPTX
Foundations of Marketo Engage - Powering Campaigns with Marketo Personalization
bbedford2
 
PDF
Meet in the Middle: Solving the Low-Latency Challenge for Agentic AI
Alluxio, Inc.
 
PPTX
Get Started with Maestro: Agent, Robot, and Human in Action – Session 5 of 5
klpathrudu
 
PDF
Is Framer the Future of AI Powered No-Code Development?
Isla Pandora
 
PPTX
Library_Management_System_PPT111111.pptx
nmtnissancrm
 
PDF
AOMEI Partition Assistant Crack 10.8.2 + WinPE Free Downlaod New Version 2025
bashirkhan333g
 
PPTX
UI5con_2025_Accessibility_Ever_Evolving_
gerganakremenska1
 
PDF
AI Prompts Cheat Code prompt engineering
Avijit Kumar Roy
 
PDF
Wondershare PDFelement Pro Crack for MacOS New Version Latest 2025
bashirkhan333g
 
PDF
MiniTool Partition Wizard Free Crack + Full Free Download 2025
bashirkhan333g
 
PPTX
Function & Procedure: Function Vs Procedure in PL/SQL
Shani Tiwari
 
PDF
MiniTool Power Data Recovery 8.8 With Crack New Latest 2025
bashirkhan333g
 
PDF
Top Agile Project Management Tools for Teams in 2025
Orangescrum
 
PDF
How to Hire AI Developers_ Step-by-Step Guide in 2025.pdf
DianApps Technologies
 
PDF
ERP Consulting Services and Solutions by Contetra Pvt Ltd
jayjani123
 
PPTX
Comprehensive Risk Assessment Module for Smarter Risk Management
EHA Soft Solutions
 
PPTX
iaas vs paas vs saas :choosing your cloud strategy
CloudlayaTechnology
 
PPTX
Smart Doctor Appointment Booking option in odoo.pptx
AxisTechnolabs
 
PDF
SAP Firmaya İade ABAB Kodları - ABAB ile yazılmıl hazır kod örneği
Salih Küçük
 
PPTX
Agentic Automation: Build & Deploy Your First UiPath Agent
klpathrudu
 
Foundations of Marketo Engage - Powering Campaigns with Marketo Personalization
bbedford2
 
Meet in the Middle: Solving the Low-Latency Challenge for Agentic AI
Alluxio, Inc.
 
Get Started with Maestro: Agent, Robot, and Human in Action – Session 5 of 5
klpathrudu
 
Is Framer the Future of AI Powered No-Code Development?
Isla Pandora
 
Library_Management_System_PPT111111.pptx
nmtnissancrm
 
AOMEI Partition Assistant Crack 10.8.2 + WinPE Free Downlaod New Version 2025
bashirkhan333g
 
UI5con_2025_Accessibility_Ever_Evolving_
gerganakremenska1
 
AI Prompts Cheat Code prompt engineering
Avijit Kumar Roy
 
Wondershare PDFelement Pro Crack for MacOS New Version Latest 2025
bashirkhan333g
 
MiniTool Partition Wizard Free Crack + Full Free Download 2025
bashirkhan333g
 
Function & Procedure: Function Vs Procedure in PL/SQL
Shani Tiwari
 
MiniTool Power Data Recovery 8.8 With Crack New Latest 2025
bashirkhan333g
 
Top Agile Project Management Tools for Teams in 2025
Orangescrum
 
How to Hire AI Developers_ Step-by-Step Guide in 2025.pdf
DianApps Technologies
 
ERP Consulting Services and Solutions by Contetra Pvt Ltd
jayjani123
 
Comprehensive Risk Assessment Module for Smarter Risk Management
EHA Soft Solutions
 
iaas vs paas vs saas :choosing your cloud strategy
CloudlayaTechnology
 
Smart Doctor Appointment Booking option in odoo.pptx
AxisTechnolabs
 
SAP Firmaya İade ABAB Kodları - ABAB ile yazılmıl hazır kod örneği
Salih Küçük
 
Agentic Automation: Build & Deploy Your First UiPath Agent
klpathrudu
 
Ad

What are restful web services?

  • 1. What are Restful Web Services? Introduction Restful Web Services is a lightweight, manageable and scalable service based on the REST architecture. Restful Web Service exposes your application’s API in a secure, uniform, and stateless manner to the calling client. Many use Restful architecture to create web-based APIs as I created for a project, it is a Restful based News API that enables users to fetch and download worldwide news data. Newsdata.io is the platform that I
  • 2. am talking about, and you can check out the website and register to get a free news API key. The calling customer can perform predefined operations using the Restful service. The underlying protocol for REST is HTTP.REST stands for REpresentational State Transfer. Key elements of REST REST web services have come a long way since their inception. In 2002, the Web Consortium published the definition of WSDL and SOAP web services. This formed the standard for implementing web services. In 2004, the Web Consortium also published the definition of an additional standard called RESTful. Over the past two years, this standard has become very popular. And it’s used by many of the world’s most popular websites, including Facebook and Twitter. REST is a means of accessing resources located in a particular environment. For example, you might have a server that could host important documents, pictures, or videos. These are all examples of resources. If a client, such as a web browser, needs any of these resources, it should send a request to the server to access these resources. REST services now define a way to access these resources. The key elements of a RESTful implementation are as follows:
  • 3. Resources The first key element is the resource itself. Let assume that a web application on a server has records of several employees. Request Verbs These describe what you want to do with the resource. A browser issues a GET verb to indicate to the endpoint that it wants to get the data. However, there are many other verbs available including POST, PUT, and DELETE. Request Headers These are additional instructions sent with the request. These might define the type of response required or the authorization details. Request Body Data is sent with the request. Data is normally sent in the request when a POST request is sent to REST web services. In a POST call, the client is actually telling REST web services that it wants to add a resource to the server. Then the body of the request would have the details of the resource that is to be added to the server. Response Body This is the main body of the response.
  • 4. Response Status codes These codes are the general codes that are returned along with the response from the webserver. An example is code 200 which is normally returned if there is no error when returning a response to the client. The following actions would have their respective meanings. Suppose we have a RESTful web service defined in the location. When the client makes a request to this web service, it can specify any of the normal HTTP verbs of GET, POST, DELETE, and PUT. arrive If the respective verbs have been sent by the client. POST — Create a REST API resource. GET — Retrieve information about the REST API resource. PUT — Update a REST API resource. DELETE — Delete a REST API resource or related component. Why Restful Restful mostly came into popularity due to the following reasons: 1. Heterogeneous languages and environments
  • 5. This is one of the fundamental reasons which is the same we have also seen for SOAP. Allows web applications based on various programming languages to communicate with each other. Using Restful services, these web applications can reside in different environments, some can be on Windows, others on Linux. But in the end, no matter what the environment, the end result should always be the same where they should be able to talk to each other. Relying on web services provides this flexibility for applications built on various programming languages and platforms to communicate with each other. The image below shows an example of a web application that should communicate with other applications such as Facebook, Twitter, and Google. Now if a client app were to work with sites like Facebook, Twitter, etc., it would likely know what language Facebook, Google, and Twitter are built on, as well as what platform they are built on. Based on this we can write our web application interface code, but it could turn out to be a nightmare.
  • 6. Facebook, Twitter, and Google exhibit their functionality in the form of Restful Web Services. This allows any client application to call these web services through REST. 2. The event of Devices Nowadays everything has to work on mobile devices, be it mobile devices, laptops, or even car systems. Can you imagine the amount of effort that goes into trying to code apps on these devices to communicate with normal web apps? Again, Restful APIs can make this job easier because, as mentioned in point n. 1, you don’t really need to know what the underlying layer of the device is. 3. Finally is the event of the Cloud Everything moves to the cloud. Applications are slowly moving to cloud-based systems like Azure or Amazon. Azure and Amazon provide many APIs based on the Restful architecture. Consequently, applications must now be developed in such a way as to be made compatible with the Cloud. Therefore, since all cloud-based architectures work on the REST principle, it makes more sense for web services to be programmed on the REST service-based architecture to get the most out of cloud-based services. Restful Architecture An application or architecture considered RESTful or REST-style has the following characteristics
  • 7. 1. State and functionality are divided into distributed resources This means that each resource must be accessible through the normal HTTP commands of GET, POST, PUT or DELETE. So if someone wants to get a file from a server, they need to be able to send the GET request and get the file. If they want to put a file on the server, they must be able to send the POST or PUT request, and finally, if they want to delete a file from the server, they can send the DELETE request. 2. The architecture is client/server, stateless, layered, and supports caching Client-server is the typical architecture where the server can be the webserver hosting the application and the client can be as simple as the web browser. Stateless means that the state of the application is not maintained in REST. For example, if you delete a resource from a server using the DELETE command, you cannot expect the deletion information to be passed on to the next request. To ensure that the resource is deleted, the GET request must be sent. The GET request is used to first get all the resources on the server. After that, you need to check if the resource has been deleted successfully. RESTFul Principles and Constraints The REST architecture is based on certain characteristics which are developed below. Any RESTful web service must meet the following
  • 8. characteristics to be called RESTful. These features are also referred to as design principles that should be followed when using RESTful-based services. 1. RESTFul Client-Server This is the fundamental requirement of a REST-based architecture. This means that the server will have a RESTful web service that will provide the requested functionality to the client. The client sends a request to the web service on the server. The server would either reject the request or comply and provide an adequate response to the client. 2. Stateless The concept of a stateless state means that it is up to the client to ensure that all requested information is provided to the server. This is necessary for the server to correctly process the response. The server should not keep any information between client requests. This is a very simple, independent question-and-answer sequence. The client asks a question, the server responds appropriately. The customer will ask another question. The server will not remember the previous question and answer scenario and will have to answer the new question independently. 3. Cache
  • 9. The concept of caching is to help with the stateless problem described in the last point. Since each server-client request is independent in nature, sometimes the client may request the same request from the server again. This even if it was already required in the past. This request will go to the server and the server will give a response. This increases the traffic on the network. Caching is a concept implemented on the client to store requests that have already been sent to the server. So if the same request is given by the client, instead of going to the server, it would go to the cache and get the requested information. This saves the amount of round-trip network traffic from the client to the server. 4. Layered System The concept of a layered system is that any additional layer such as a middleware layer can be inserted between the client and the actual server hosting the RESTFul web service (the middleware layer is where all the business logic is created. This could be an extra service created that the client could interact with before calling the web service.). But the introduction of this layer must be transparent so as not to disturb the interaction between the client and the server. 5. Interface/Uniform Contract
  • 10. This is the technique behind how RESTful web services work. RESTful basically works on the HTTP web layer and uses the following key verbs to work with the resources on the POST — To create a resource on the GET — To retrieve a resource from the PUT — To change the state of a resource or to update DELETE — To delete or delete a resource from the server