Top REST API Best Practices

Top REST API Best Practices

In this post, my goal will be to explain REST as clearly as possible so you can clearly understand when and how to use it, as well as what it is in essence.

In this post, my goal will be to explain REST as clearly as possible so you can clearly understand when and how to use it, as well as what it is in essence.

Many giants like Facebook, Google, GitHub, Netflix, Amazon, and Twitter have their own REST(ful) APIs that you can access to get or even write data.

But why all the need for REST?

Is it that good and why is it so prevalent?

Surely it’s not the only way to convey messages?

What is the difference between REST and HTTP?

Well, it turns out REST is pretty flexible and compatible with HTTP (which is the main protocol the internet is based upon). Since it is an architectural style and not the standard, it provides a lot of freedom to implement various design best practices. Did I mention it’s language agnostic?

In this blog post, my goal will be to explain REST as clearly as possible so you can clearly understand when and how to use it, as well as what it is in essence.

We’ll go through some basics and definitions as well as show off some REST API best practices. This should give you all the knowledge you need to implement REST APIs in any language in which you prefer to code.

If you are not that familiar with HTTP, I recommend reading our HTTP series, or at least part 1 of it, so you can digest this material more easily.

So What Is REST Essentially?

REST (Representational State Transfer) is an architectural style founded by Roy Fielding in his Ph.D. dissertation “Architectural Styles and the Design of Network-based Software Architectures” at UC Irvine. He developed it in parallel with HTTP 1.1 (no pressure).

We use REST primarily as a way to communicate between computer systems on the World Wide Web.

Is REST Bound to HTTP?

By definition, it’s not. Although you can use some other application protocol with REST, HTTP has remained the undisputed champion among application protocols when it comes to the implementation of REST.

REST and HATEOAS support

HATEOAS or the **Hypermedia As The Engine Of Application State **is the important feature of every scalable and flexible REST API.

The HATEOAS constraint proposes that the client and server communicate entirely utilizing the hypermedia.

There are several advantages to using hypermedia:

  • It enables API designers rather than to include everything they can in each response, to provide one thing properly and hypermedia links to related endpoints and thus decouple the design
  • It helps API evolve and mature more gracefully
  • It provides the user with the means to explore the API more deeply

So it is clear that the HATEOAS was designed with durability in mind.

Here is how GitHub does it:

GET https://api.github.com/users/codemazeblog

Response:

{
  "login": "CodeMazeBlog",
  "id": 29179238,
  "avatar_url": "https://avatars0.githubusercontent.com/u/29179238?v=4",
  "gravatar_id": "",
  "url": "https://api.github.com/users/CodeMazeBlog",
  "html_url": "https://github.com/CodeMazeBlog",
  "followers_url": "https://api.github.com/users/CodeMazeBlog/followers",
  "following_url": "https://api.github.com/users/CodeMazeBlog/following{/other_user}",
  "gists_url": "https://api.github.com/users/CodeMazeBlog/gists{/gist_id}",
  "starred_url": "https://api.github.com/users/CodeMazeBlog/starred{/owner}{/repo}",
  "subscriptions_url": "https://api.github.com/users/CodeMazeBlog/subscriptions",
  "organizations_url": "https://api.github.com/users/CodeMazeBlog/orgs",
  "repos_url": "https://api.github.com/users/CodeMazeBlog/repos",
  "events_url": "https://api.github.com/users/CodeMazeBlog/events{/privacy}",
  "received_events_url": "https://api.github.com/users/CodeMazeBlog/received_events",
  "type": "User",
  "site_admin": false,
  "name": "Code Maze",
  "company": "Code Maze",
  "blog": "https://code-maze.com",
  "bio": "A practical programmers' resource.",
  ...
}

As you can see, besides the crucial information requested by the client, you can find a bunch of related hypermedia links in the response which lead you to other parts of the API you can freely explore.

What Does RESTful API Mean?

“RESTful” implies a few features:

  • It enables API designers rather than to include everything they can in each response, to provide one thing properly and hypermedia links to related endpoints and thus decouple the design
  • It helps API evolve and mature more gracefully
  • It provides the user with the means to explore the API more deeply

So, the RESTful API is a service that follows these rules (hopefully) and uses HTTP methods to manipulate the set of resources.

But why do we need or use RESTful APIs?

Because they give us an easy, flexible, and scalable way to make distributed applications that communicate over the internet.

Can We Have Too Much REST?

Yes, you guessed it. Yes, we can.

There is even a phrase for the people that follow REST fanatically, as defined by Mike Schinkel.

A RESTifarian is a zealous proponent of the REST software architectural style as defined by Roy T. Fielding in Chapter 5 of his Ph.D. dissertation at UCIrvine. You can find RESTifarians in the wild on the REST-discuss mailing list. But be careful, RESTifarians can be extremely meticulous when discussing the finer points of REST, as I learned recently while participating on the list.
Too much of anything can be bad.

We need a bit pragmatism to make good applications and services. A theory is important to know and understand, but the implementation of that theory is what differentiates bad vs good vs excellent applications. So be smart, have the end user in mind.

So let’s look at some important points that make APIs “shine” and the lives of the users a whole lot easier.

Abstract vs Concrete APIs

When developing software we often use abstraction and polymorphism to get most of our applications. We want to reuse as much of the code as possible.

So should we write our APIs that way too?

Well, that is not exactly the case with APIs. For REST APIs, concrete is better than abstract. Can you guess why?

Let me show you a few examples.

Let’s look at two API versions. Is it better to have an API that has one /entities or an API that has /owners/blogs and, /blogpostsseparately?

Which one seems more descriptive to you as a developer? Which API would you rather use?

I would always choose the second one.

URI Formatting (Nouns, not Verbs): Good URL vs Bad URL Examples

Here is another REST API best practice. How should you format your endpoints?

If you use the software development approach you will end up with something like this:

/getAllBlogPosts

/updateBlogPost/12

/deleteBlogPost/12

/getAuthorById/3

/deleteAuthor/3

/updateAuthor/3

You get the point… There will be a ton of endpoints, each one doing something else. There is a better system for sorting out this mess.

Treat the resource like a noun, and the HTTP method as a verb. If you do it like that, you’ll end up with something like this:

GET /blogposts - gets all the blog posts.

GET /blogposts/12 - gets the blog post with the id 12.

POST /blogposts - adds a new blog post and returns the details.

DELETE /blogposts/12 - removes the blog post with the id 12.

GET /authors/3/blogposts - gets all the blog posts of the author with id 3.

This is a cleaner and more precise way to use the API. It is immediately clear to the end user, and there is a method to the madness.

You can make it even cleaner by using singulars instead of plurals for the resource names. That one is up to you.

Error Handling

This is another important aspect of API building. There are a few good ways to handle errors.

Let’s see how the top dogs do it.

Twitter:

  • It enables API designers rather than to include everything they can in each response, to provide one thing properly and hypermedia links to related endpoints and thus decouple the design
  • It helps API evolve and mature more gracefully
  • It provides the user with the means to explore the API more deeply
{"errors":[{"code":215,"message":"Bad Authentication data."}]}

Twitter gives you the Status Code and Error Code with the short description of the nature of the error that occurred. They leave it up to you to look the codes up on their Response Codes page.

Facebook:

  • It enables API designers rather than to include everything they can in each response, to provide one thing properly and hypermedia links to related endpoints and thus decouple the design
  • It helps API evolve and mature more gracefully
  • It provides the user with the means to explore the API more deeply
{
   "error": {
      "message": "An active access token must be used to query information about the current user.",
      "type": "OAuthException",
      "code": 2500,
      "fbtrace_id": "DzkTMkgIA7V"
   }
}

Facebook gives you a more descriptive error message.

Twilio:

  • It enables API designers rather than to include everything they can in each response, to provide one thing properly and hypermedia links to related endpoints and thus decouple the design
  • It helps API evolve and mature more gracefully
  • It provides the user with the means to explore the API more deeply
<?xml version='1.0' encoding='UTF-8'?>
<TwilioResponse>
    <RestException>
        <Code>20404</Code>
        <Message>The requested resource /2010-04-01/Accounts/1234/IncomingPhoneNumbers/1234 was not found</Message>
        <MoreInfo>https://www.twilio.com/docs/errors/20404</MoreInfo>
        <Status>404</Status>
    </RestException>
</TwilioResponse>

Twilio gives you an XML response by default and the link to the documentation where you can find the error details.

As you can see, the approaches to error handling differ from implementation to implementation.

The important thing is not to leave the user of the REST API “hanging,” i.e. not knowing what happened or aimlessly wandering through the wastes of StackOverflow searching for the explanation.

Status Codes

When designing a REST API, you communicate with the API user by utilizing HTTP Status Codes. There are a lot of status codes, describing multiple possible responses.

But just how many should you use? Should you have a strict status code for every situation?

As with many things in life, the KISS principle applies here too. There are over 70 status codes out there. Do you know them by heart? Will the potential API user know them all, or will it once again result in googling stuff?

Most developers are familiar with the most common status codes:

  • It enables API designers rather than to include everything they can in each response, to provide one thing properly and hypermedia links to related endpoints and thus decouple the design
  • It helps API evolve and mature more gracefully
  • It provides the user with the means to explore the API more deeply

By starting with these three, you can cover most of the functionalities of your REST API.

Other commonly seen codes include:

  • It enables API designers rather than to include everything they can in each response, to provide one thing properly and hypermedia links to related endpoints and thus decouple the design
  • It helps API evolve and mature more gracefully
  • It provides the user with the means to explore the API more deeply

You can use these to help the user quickly figure out what the result was. You should probably include some kind of message if you feel the status code is not descriptive enough like we discussed in the error handling section. Once again, be pragmatic, help the user by using a limited number of codes and descriptive messages.

You can find the complete HTTP Status codes list, as well as other helpful HTTP stuff here.

Security

There is not much to be said about REST API security because REST doesn’t deal with security. It relies upon standard HTTP mechanisms like basic or digest authentication.

Every request should be made over HTTPS.

There are many tricks to improve the security of your REST API, but you must be cautious when implementing them, because of the stateless nature of REST. Remembering the state of the last request goes out of the window, and the client is where the state should be stored and verified.

Timestamping and logging requests can help a bit too.

There is much more to be said on this topic, but it is out of the scope of this post. We have a nice post on HTTP Security if you want to learn more about that.

REST API Versioning

You’ve already written your REST API and it has been very successful and many people have used it and are happy with it. But you have that juicy new functionality that breaks other parts of the system. The breaking change.

Never fear, there is a solution for that!

Before you start making your API, you can version your API by prefixing the endpoints by the API version: https://api.example.com/v1/authors/2/blogposts/13

This way you can always increment your API version number (eg. v2, v3…) whenever there are breaking changes in your API. This also signals to the users that something drastic has changed and they should be careful when using the new version.

Importance of Documentation

This one is a no-brainer. You could be the best API designer in the world, but without documentation, your API is as good as dead.

Proper documentation is essential for every software product and web service alike.

You can help the user by being consistent and using clear and descriptive syntax, sure. But there is no real replacement for good ol’ documentation pages.

Here are some of the great examples:

  • It enables API designers rather than to include everything they can in each response, to provide one thing properly and hypermedia links to related endpoints and thus decouple the design
  • It helps API evolve and mature more gracefully
  • It provides the user with the means to explore the API more deeply

There are many tools that can help you document your API, but don’t forget to add the human touch, only one human can properly understand another. For now at least (looking at you AI).

Conclusion

We went through many concepts of the REST API building and covered some of the top REST API best practices. These might seem a bit strange or overwhelming when served at once, but try making your own REST API. And try to implement some the REST API best practices you learned here.

Make the tiniest API possible and see how it looks. You’ll be surprised how well it can turn out by just following these few practices.

What the difference between REST API and RESTful API?

What the difference between REST API and RESTful API?

Representational state transfer (REST) is a style of software architecture. As described in a dissertation by Roy Fielding, REST is an "architectural style" that basically exploits the existing technology and protocols of the Web. RESTful is typically used to refer to web services implementing such an architecture.

The short answer is that REST stands for Representational State Transfer. It’s an architectural pattern for creating web services. A RESTful service is one that implements that pattern.

The long answer starts with “sort of” and “it depends” and continues with more complete definitions.

Defining REST

Let’s start by defining what REST is and is not. For some, REST means a server that exchanges JSON documents with a client over HTTP. Not only is that not a complete definition, but it’s also not always true. The REST specification doesn’t require HTTP or JSON. (The spec doesn’t mention JSON or XML at all.)

The Origins of REST

Roy Fielding introduced the REST architectural pattern in a dissertation he wrote in 2000. The paper defines a means for clients and servers to exchange application data. A key feature is that the client doesn’t need to know anything about the application in advance. The link is to chapter five of his paper. While the entire dissertation describes the hows and whys of REST, that chapter defines the architectural pattern.

Fielding doesn’t mandate specific requirements. Instead, he defines REST regarding constraints and architectural elements.

REST’s Architectural Constraints

Here is a summary of the constraints.

  • Client-server – REST applications have a server that manages application data and state. The server communicates with a client that handles the user interactions. A clear separation of concerns divides the two components. This means you can update and improve them in independent tracks.
  • Stateless – servers don’t maintain any client state. Clients manage their application state. Their requests to servers contain all the information required to process them.
  • Cacheable – servers must mark their responses as cacheable or not. So, infrastructures and clients can cache them when possible to improve performance. They can dispose of non-cacheable Information, so no client uses stale data.
  • Uniform interface – this constraint is REST’s most well known feature or rule, depending on who you ask. Fielding says “The central feature that distinguishes the REST architectural style from other network-based styles is its emphasis on a uniform interface between components.” REST services provide data as resources, with a consistent namespace. We’ll cover this in detail below.
  • Layered system – components in the system cannot “see” beyond their layer. So, you can easily add load-balancers and proxies to improve security or performance.

A RESTful service is more than a web server that exchanges JSON, or any other, documents. These constraints work together to create a very specific type of application.

Applying the Constraints

First, the client-server, layered systems and stateless constraints combine to form an application with solid boundaries and clear separations between concerns. Data moves from the server to the client upon request. The client displays or manipulates it. If the state changes, the client sends it back to the server for storage. Fielding specifically contrasts REST with architectures that use distributed objects to hide data from other components. In REST, the client and server share knowledge about data and state. The architecture doesn’t conceal data, it only hides implementations.

The cacheable and uniform state constraints go one step further. Application data is available to clients in a clear and consistent interface and cached when possible.

So, that’s the technical definition of REST. What does it look like in the real world?

RPC Over HTTP vs. RESTful

Often when someone says that a service “isn’t REST,” they’re looking at the URIs or how the service uses HTTP verbs. They’re referring to REST’s presentation of data as a uniform set of resources.

This distinction is sometimes framed as a difference between remote procedures calls (RPC) and REST. Imagine a web service for listing, adding, and removing, items from an e-commerce inventory.

In one version, there’s a single URL that we query with HTTP GETs or POSTs.  You interact with the service by POSTing a document, setting the contents to reflect what you want to do.

Add new items with a POST with a NewItem:

POST /inventory HTTP/1.1
 
{
    "NewItem": {
          "name": "new item",
          "price": "9.99",
          "id": "1001"
      }
}    

Query for items with a POST and an ItemRequest:

POST /inventory HTTP/1.1
 
{
    "ItemRequest": {
          "id": "1001"
      }
}

Some implementations accept a request for a new item with a get, too.

POST /inventory?id=1001 HTTP/1.1

We also change or delete items with a POST and an ItemDelete or ItemUpdate.

POST /inventory HTTP/1.1
 
{
    "ItemDelete": {
          "id": "1001"
      }
}

This isn’t REST. We’re not exchanging the state of resources. We’re calling a function with arguments that happen to be in a JSON document or URL arguments.

A RESTful service has a URI for each item in the inventory.

So, adding a new item would look like the example above.

POST /item HTTP/1.1
 
{
    "Item": {
          "name": "new item",
          "price": "9.99",
          "id": "1001"
      }
}    

But the similarities end there. Retrieving an item is always a GET:

GET /item/1001 HTTP/1.1   

Deleting is a DELETE:

DELETE /item/1001 HTTP/1.1  

Modifying an item is a PUT:

POST /inventory HTTP/1.1
 
{
    "Item": {
          "name": "new item",
          "price": "7.99",
          "id": "1001"
      }
}    

The difference is important. In REST, operations that use distinct HTTP actions. These verbs correspond directly to the activity on the data. GET, POST, PUT, DELETE and PATCH all have specific contracts. Most well-designed REST APIs also return specific HTTP codes, depending on the result of the request.

The critical point is that the URIs operate on the data, not on remote methods.

But there’s another reason why the resource model is essential.

REST vs RESTful and the Richardson Maturity Model

When you model your URIs after resources and use HTTP verbs you make your API predictable. Once developers know how you defined your resources, they can almost predict what the API looks like. Here again, the emphasis is on understanding the data, not the operations.

But even if you can’t make the API entirely predictable, you can document any REST service with hypertext. So, each item returned in the inventory app would contain links for deleting, modifying, or setting the inventory level of the resource. Fielding says that before a service is RESTful, it must provide hypertext media as part of the API.

Many sites don’t meet this requirement but are still called REST. Fact is, many sites break the rules in one way or another. So many that Leonard Richardson created a model breaks down REST into levels of compliance

We’ve already covered the source levels:

  • 0 – exporting an API over HTTP with methods called with arguments
  • 1 – Exporting resources instead of methods
  • 2 – Proper use of HTTP verbs
  • 3 – Exporting hypertext with objects that make all or part of the API discoverable.

Richardson’s model is his own, and it doesn’t map directly into Fielding’s spec. Since Fielding requires level three, he would say that most apps aren’t REST anyway.

The point is many services that we colloquially refer to as REST, technically aren’t.

REST vs RESTful: Does It Matter?

So, does the REST vs. RESTful comparison matter? Probably not. How well your architecture complies with an arbitrary standard isn’t as important with how well it suits your needs and can grow with your business.

The REST architectural pattern has many advantages. Fielding designed it for the web and, 18 years later, most of the constraints he had in mind are still with us. In 2000 we didn’t have Android or the iPhone. IE5 had 50% of the browser market share. It’s biggest rival was Firefox. But Fielding recognized what online applications needed and how web clients would evolve from HTML display engines into complete applications. The tools we use today have grown to suit REST, not the other way around.

Thank you for reading. Hope this tutorial will help you!

What is REST API? | Restful Web Service

What is REST API? | Restful Web Service

In this post "Restful Web Service", you'll learn: What is Web services, what is API, What is REST API, How REST works and Implementation of REST API

What is REST API? | Restful Web Service

A REST API defines a set of functions to process requests and responses via HTTP protocol.

REST is used in mobile application as well as in web applications.


What the difference between REST API and RESTful API?

What the difference between REST API and RESTful API?

Representational state transfer (REST) is a style of software architecture. As described in a dissertation by Roy Fielding, REST is an "architectural style" that basically exploits the existing technology and protocols of the Web. RESTful is typically used to refer to web services implementing such an architecture.

The short answer is that REST stands for Representational State Transfer. It’s an architectural pattern for creating web services. A RESTful service is one that implements that pattern.

The long answer starts with “sort of” and “it depends” and continues with more complete definitions.

Defining REST

Let’s start by defining what REST is and is not. For some, REST means a server that exchanges JSON documents with a client over HTTP. Not only is that not a complete definition, but it’s also not always true. The REST specification doesn’t require HTTP or JSON. (The spec doesn’t mention JSON or XML at all.)

The Origins of REST

Roy Fielding introduced the REST architectural pattern in a dissertation he wrote in 2000. The paper defines a means for clients and servers to exchange application data. A key feature is that the client doesn’t need to know anything about the application in advance. The link is to chapter five of his paper. While the entire dissertation describes the hows and whys of REST, that chapter defines the architectural pattern.

Fielding doesn’t mandate specific requirements. Instead, he defines REST regarding constraints and architectural elements.

REST’s Architectural Constraints

Here is a summary of the constraints.

  • Client-server – REST applications have a server that manages application data and state. The server communicates with a client that handles the user interactions. A clear separation of concerns divides the two components. This means you can update and improve them in independent tracks.
  • Stateless – servers don’t maintain any client state. Clients manage their application state. Their requests to servers contain all the information required to process them.
  • Cacheable – servers must mark their responses as cacheable or not. So, infrastructures and clients can cache them when possible to improve performance. They can dispose of non-cacheable Information, so no client uses stale data.
  • Uniform interface – this constraint is REST’s most well known feature or rule, depending on who you ask. Fielding says “The central feature that distinguishes the REST architectural style from other network-based styles is its emphasis on a uniform interface between components.” REST services provide data as resources, with a consistent namespace. We’ll cover this in detail below.
  • Layered system – components in the system cannot “see” beyond their layer. So, you can easily add load-balancers and proxies to improve security or performance.

A RESTful service is more than a web server that exchanges JSON, or any other, documents. These constraints work together to create a very specific type of application.

Applying the Constraints

First, the client-server, layered systems and stateless constraints combine to form an application with solid boundaries and clear separations between concerns. Data moves from the server to the client upon request. The client displays or manipulates it. If the state changes, the client sends it back to the server for storage. Fielding specifically contrasts REST with architectures that use distributed objects to hide data from other components. In REST, the client and server share knowledge about data and state. The architecture doesn’t conceal data, it only hides implementations.

The cacheable and uniform state constraints go one step further. Application data is available to clients in a clear and consistent interface and cached when possible.

So, that’s the technical definition of REST. What does it look like in the real world?

RPC Over HTTP vs. RESTful

Often when someone says that a service “isn’t REST,” they’re looking at the URIs or how the service uses HTTP verbs. They’re referring to REST’s presentation of data as a uniform set of resources.

This distinction is sometimes framed as a difference between remote procedures calls (RPC) and REST. Imagine a web service for listing, adding, and removing, items from an e-commerce inventory.

In one version, there’s a single URL that we query with HTTP GETs or POSTs.  You interact with the service by POSTing a document, setting the contents to reflect what you want to do.

Add new items with a POST with a NewItem:

POST /inventory HTTP/1.1
 
{
    "NewItem": {
          "name": "new item",
          "price": "9.99",
          "id": "1001"
      }
}    

Query for items with a POST and an ItemRequest:

POST /inventory HTTP/1.1
 
{
    "ItemRequest": {
          "id": "1001"
      }
}

Some implementations accept a request for a new item with a get, too.

POST /inventory?id=1001 HTTP/1.1

We also change or delete items with a POST and an ItemDelete or ItemUpdate.

POST /inventory HTTP/1.1
 
{
    "ItemDelete": {
          "id": "1001"
      }
}

This isn’t REST. We’re not exchanging the state of resources. We’re calling a function with arguments that happen to be in a JSON document or URL arguments.

A RESTful service has a URI for each item in the inventory.

So, adding a new item would look like the example above.

POST /item HTTP/1.1
 
{
    "Item": {
          "name": "new item",
          "price": "9.99",
          "id": "1001"
      }
}    

But the similarities end there. Retrieving an item is always a GET:

GET /item/1001 HTTP/1.1   

Deleting is a DELETE:

DELETE /item/1001 HTTP/1.1  

Modifying an item is a PUT:

POST /inventory HTTP/1.1
 
{
    "Item": {
          "name": "new item",
          "price": "7.99",
          "id": "1001"
      }
}    

The difference is important. In REST, operations that use distinct HTTP actions. These verbs correspond directly to the activity on the data. GET, POST, PUT, DELETE and PATCH all have specific contracts. Most well-designed REST APIs also return specific HTTP codes, depending on the result of the request.

The critical point is that the URIs operate on the data, not on remote methods.

But there’s another reason why the resource model is essential.

REST vs RESTful and the Richardson Maturity Model

When you model your URIs after resources and use HTTP verbs you make your API predictable. Once developers know how you defined your resources, they can almost predict what the API looks like. Here again, the emphasis is on understanding the data, not the operations.

But even if you can’t make the API entirely predictable, you can document any REST service with hypertext. So, each item returned in the inventory app would contain links for deleting, modifying, or setting the inventory level of the resource. Fielding says that before a service is RESTful, it must provide hypertext media as part of the API.

Many sites don’t meet this requirement but are still called REST. Fact is, many sites break the rules in one way or another. So many that Leonard Richardson created a model breaks down REST into levels of compliance

We’ve already covered the source levels:

  • 0 – exporting an API over HTTP with methods called with arguments
  • 1 – Exporting resources instead of methods
  • 2 – Proper use of HTTP verbs
  • 3 – Exporting hypertext with objects that make all or part of the API discoverable.

Richardson’s model is his own, and it doesn’t map directly into Fielding’s spec. Since Fielding requires level three, he would say that most apps aren’t REST anyway.

The point is many services that we colloquially refer to as REST, technically aren’t.

REST vs RESTful: Does It Matter?

So, does the REST vs. RESTful comparison matter? Probably not. How well your architecture complies with an arbitrary standard isn’t as important with how well it suits your needs and can grow with your business.

The REST architectural pattern has many advantages. Fielding designed it for the web and, 18 years later, most of the constraints he had in mind are still with us. In 2000 we didn’t have Android or the iPhone. IE5 had 50% of the browser market share. It’s biggest rival was Firefox. But Fielding recognized what online applications needed and how web clients would evolve from HTML display engines into complete applications. The tools we use today have grown to suit REST, not the other way around.

Thank you for reading. Hope this tutorial will help you!