Most of us use “Postman” for Rest API calls testing yet there is a number of options for doing the same. But if you are using “Visual Studio Code Editor” in your project for coding, then this article will introduce to you a new extension called “Thunder Client” which is the best extension to do the same thing. I have used this extension in a recent project and since it has various advantages, I am sharing in this article that how you can also use it.
Now the first question that arises is Why to use this extension? And the answer to it is,
- Simple, clean, and easy to use user interface.
- Lightweight
- Handle large responses and view responses in full screen.
- Collections & Environment Variables Support
- One-click access to most of the functionality.
Let’s start with installing the extension in Visual Studio Code.
Step 1
Click on “Extensions” in Visual studio code, then in “Search Extension” write “Thunder Client”. The following screens will be seen,
Step 2
Click on Install
Step 3
After successful installation you will be able to see "Thunder Client Icon" at the end of installed extensions, like this,
Now, the next question that comes in the mind is “how to use it”. This could be answered through the subsequent example:
For explanation purposes: https://jsonplaceholder.typicode.com/ is used for dummy APIs.
Step 1
Click on “Thunder Client Icon”, and you will see the following screenshots,
Step 2
Click on “New Request” and after that choose the appropriate HTTP Request from dropdown like GET, PUT, POST, DELETE, PATCH etc. For a better explanation, I have sent a get request.
Use this link: https://jsonplaceholder.typicode.com/posts in getting.
You can also see different options below the dropdown for making request with parameters like,
- Params : To send the Query Parameters.
- Auth : For sending token if API requires authentication. You will authenticate with Basic Auth, Bearer Token and OAuth2.0
- Headers : For passing request header data.
- Body : To pass the data with POST request in a different format.
Step 3
Now, if you want to make a POST request then it will follow the same scenario as above. Like in post request :
Change the dropdown value to POST, and use the following link for testing,
https://jsonplaceholder.typicode.com/posts
after then put the following JSON into the body tab
- {
- "title": "Thunder Client",
- "body": "Good Extesion",
- "userId": 1
- }
And in “Headers” tab add the following,
- In header : “Content-Type” and
- In value : application/json; charset=UTF-8
Now, after clicking on send, the following results would be obtained,
In a similar way, you can also test the other API request.
Conclusion
This article is helpful in knowing how one can use the “Thunder Client” extension for making REST API Calls. All the queries related to this article and sample project are always welcomed. Thanks for reading.