How to test API using ThunderClient

How to test API using ThunderClient

Table of contents

No heading

No headings in the article.

To test an API using ThunderClient, you can follow these steps:

  1. Open the ThunderClient tab in VS Code by clicking on the ThunderClient icon in the left-hand sidebar.

  2. Create a new request by clicking on the "New Request" button and giving it a name.

  3. Enter the URL of the API endpoint you want to test in the URL field.

  4. Choose the HTTP method for the request (e.g. GET, POST, PUT, DELETE).

  5. If necessary, add any request headers, query parameters, or request body.

  6. Click the "Send" button to send the request and see the response.

  7. In the response tab, you can view the status code, response headers, and response body.

  8. You can also view the response in a different format (e.g. JSON, XML, HTML) by clicking on the "View as" dropdown menu.

  9. If you need to make any changes to the request, you can do so and click "Send" again to re-send the request.

  10. You can add more requests to the collection by repeating steps 3-10.

  11. Once you have added all the requests to the collection, you can click on the "Run" button to run all the requests in sequence.

  12. The results of the collection run will be displayed in the "Results" tab. This will show the status code, response time, and response body for each request, as well as any errors that occurred.

  13. You can export the collection as a JSON or YAML file by clicking on the "Export" button in the top right corner of the collection.

  14. You can also import a collection from a JSON or YAML file by clicking on the "Import" button.

ThunderClient provides a simple and intuitive interface for testing APIs, and allows you to easily organize and run multiple requests in a collection. It also supports exporting and importing collections, which can be useful for sharing test cases or transferring them between environments.