Thunder Client - An API Testing Extension

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,
  1. Simple, clean, and easy to use user interface.
  2. Lightweight
  3. Handle large responses and view responses in full screen.
  4. Collections & Environment Variables Support
  5. 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,
 
Thunder Client
 
Step 2
 
Click on Install
 
Search Thunder Client
 
Step 3
 
After successful installation you will be able to see "Thunder Client Icon" at the end of installed extensions, like this,
 
Thunder Client Icon
 
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,
 
Thunder Client UI
 
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.
 
Thunder Client Get Example
 
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
  1. {  
  2. "title""Thunder Client",  
  3. "body""Good Extesion",  
  4. "userId": 1  
  5. }  
And in “Headers” tab add the following,
  1. In header : “Content-Type” and  
  2. In value : application/json; charset=UTF-8  
Now, after clicking on send, the following results would be obtained,
 
Thunder Client Post Example
 
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.


Similar Articles