Dattatray Kale
Nov 21, 2018 · 1 min read

In restful application, the resource is the fundamental unit.

There are six architectural constraints which make any web service — a truly RESTful API. These constraints revolve around the resource.

One of the constraints is Uniform interface. The resource should be addressable by unique (it is assumed that it would be readable) URLs and should use appropriate HTTP verbs.

In this blog, we will see Poorly written URLs and how to re-write them so that they become well-formatted and readable URLs.

We will consider the simple expense tracker application. Please see some of the use cases below.

Poorly formatted URLs and verbs.

Please see below-mentioned Url’s exposed by the restful services that are providing the solution for above-mentioned use cases. It does not only fail to follow a well-formatted URL pattern but also they are using incorrect HTTP verbs.

The better way

Above URLs can be rewritten in the better way so that those are not only well formatted and readable but also use appropriate HTTP verb as shown below.

Being Software Craftsman

I always like to build well-crafted andworking software. I enjoy working with people who share the same values of Software Craftsmanship that I do.

Dattatray Kale

Written by

Aspiring agile software craftsman, clean code, polygot, in love with different programming paradigm. I am on a never-ending journey towards mastery of software.

Being Software Craftsman

I always like to build well-crafted andworking software. I enjoy working with people who share the same values of Software Craftsmanship that I do.

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade