What is a RESTful Web Service?

What is a RESTful web service?

Representational State Transfer (REST) is an architectural style consisting of a coordinated set of constraints applied to components, connectors, and data elements, within a distributed hypermedia system to achieve desired architectural properties. Huh?

Rather than get hung up on the technical definition, the best way to describe it (for me at least), is

that a RESTful web service is the accessing a backend function using a standard URI (or URL).

You can access this URI as part of URL (like below). Click on the link below and this URL will

access a database on the backend and return a listing of customers. This is an invocation of a

web service.


Now what if you were a machine and could not click on a URL? Enter GETS and POSTS. When two

programs talk to one another using web services, they use program code to do so. All web servers are

designed to broker connection requests using (for the most part as there are others) GETS and POSTS.

  • GET - Requests data from a specified resource

  • POST - Submits data to be processed to a specified resource

So when I want to retrieve data from a web service I ask it (programatically of course), to GET a customer

list, for example, in the form of a URI.

Conversly when I want to submit data to the web server for proccessing I would issue a POST request to, (you guessed it), post data to a database.

Simple as that!

#restful #webservices