What is REST?

REST stands for Representational state transfer. It is an architectural style that can be used in web services for scalable and modifiable communication between client and server. In this architecture, the client-server uses a standardized way to exchange resource representation. The implementation of the client side is independent of the server side. As long as both of them follow the REST architecture style both of them can communicate with each other irrespective of the tech stack of framework used to build them. For example, an API hosted on a single server can be used by both mobile and web applications.

REST API requests should consist of the following:

  • An HTTP verb like GET, POST, or DELETE (denotes the kind of operation to be performed)
  • Path of the requested resource.
  • Headers to pass information about the request like what kind of content is passed in the request.
  • Optional message body containing data (if required).

Testing REST API with Postman and curl

In the world of API testing, there are many tools available. Postman and cURL are two of the most popular tools for it. Let’s look at how to use these tools for testing them. We will send some HTTP requests and explore the basic syntax for both of them in this article. The article focuses on using a fake REST API named JSON placeholder.

Similar Reads

What is REST?

REST stands for Representational state transfer. It is an architectural style that can be used in web services for scalable and modifiable communication between client and server. In this architecture, the client-server uses a standardized way to exchange resource representation. The implementation of the client side is independent of the server side. As long as both of them follow the REST architecture style both of them can communicate with each other irrespective of the tech stack of framework used to build them. For example, an API hosted on a single server can be used by both mobile and web applications....

Why Test REST API?

Testing is an important stage in the development of REST APIs. It helps to verify that the APIs are:...

Methodology of Testing REST

The following questions needs to be asked before writing tests:...

Postman vs cURL

...

Conclusion

Postman is a platform for building and testing REST APIs. It comes with a graphical user interface and has many useful features like organizing tests into collections, automated testing and API monitoring. Postman allows you to create environments, set variables and so on. You can write scripts through which developers can build automated tests. It also has version control and collaboration features which are useful for developers working in teams....

Contact Us