Today, we will talk about REST clients. They are a group of programs with a friendly graphic interface to test our API. There are many such programs, but this topic will give you information about the most popular ones. Let's start!
The Postman client
Postman is a handy tool to send requests to our API. Its toolbox has many different features, but we will take a look at Collection and Request.
Collectionis a starting point of every new API. It accumulates every request to the API, so usually, the testing is carried out one API at a time, but if you want, you can create as manyCollectionsas you need.Requestis a simple request that we send to the API, nothing special. The difference betweencurlandPostmanis that we write the requests incurlourselves; inPostman, we create them using the request constructor.
Below is an example of a request with the parameter Who is the real Slim Shady? and the value: Please stand up. It will be sent to the API specified at the beginning of the request. Also, we can quickly change the method of the request (POST, GET, and so on):
One collection can store many requests, and we can create multiple collections for different purposes, so every person can easily understand how and what is tested for each collection. In addition, you can see that we create parameters in the constructor very simply: just write the name of the parameter and its value. In curl, however, we should include all symbols.
Once the request is ready, press the Send button to get the answer:
We've received the www.google.com HTML code after a GET request. As you can see, Postman can easily create and execute requests for any accessible URL: this is a great upgrade after curl. So, RESTful clients are very good when we need to send a request; it is convenient to create and investigate them, down to headers and other small parts.
ARC
ARC (Advanced RESTful Client) is another REST client for testing and developing API services. The GUI of this program is similar to Postman. You can quickly understand what deals with what if you've already spent a couple of hours in Postman:
Like Postman, ARC can easily change the method of a request, URL, parameters, and others. The main advantage of ARC is the CODE SNIPPETS contribution: you can find many ways to write requests that you've written in various programming languages, including Python! This feature looks like this:
It is a great feature, indeed. There, we can see the API development phases or various parsers. It is a good idea to use this program instead of curl if you want to create a portion of the code after a request has been executed or if you like the blue color.
Conclusion
In this topic, we've learned about useful curl substitutions and their advantages. Postman and ARC are only two of them, but that should be enough for now. The difference is subtle — ARC is more user-friendly than Postman, but it has less functionality. Which one to use is up to you, of course.
We hope this information will help you in the future. Don't stop on the way to knowledge!