top of page

Using http methods in REST API design

To properly design a REST API we should look into RESTful principles, these were first introduced by Roy Fielding in Chapter 5 of his dissertation on network based software architectures. These divide the REST service into separated resources, manipulated using the different HTTP methods and that performs responses by the usage of the different http status codes.

So the basic design guidelines comprises the following:

As we already covered the design guidelines for Resources in REST API design, we will move into the Http methods

As stated earlier, one of the key objectives of the REST approach is using HTTP as an application protocol in order to properly define the interactions with the different resources. So, we should systematically use HTTP verbs to describe what actions are performed on the resources and facilitate the developer’s work handling recurrent CRUD operations.

The following methods are usually observed:

GET

The GET method is used to retrieve information from the given server using a given URI. Requests using GET should only retrieve data and should have no other effect on the data.

POST

A POST request is used to send data to the server, for example, customer information, file upload, etc. using HTML forms.

PUT

Replaces all current representations of the target resource with the uploaded content.

DELETE

Removes all current representations of the target resource given by a URI.

Will discuss in other chapters the usage of http status codes, as we did before with the design guidelines for Resources in REST API design.

bottom of page