> For the complete documentation index, see [llms.txt](https://smu-portal.gitbook.io/get-started/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://smu-portal.gitbook.io/get-started/book-module-tutorial/backend/test-using-postman.md).

# Test using Postman

Now that we have created our API endpoints, we need to check whether they work properly or not. To do so, we will use [Postman](https://www.postman.com/).

> Postman is a collaboration platform for API development. Postman's features simplify each step of building an API and streamline collaboration so you can create better APIs—faster.
>
> The Collaboration Platform for API Development. (n.d.). Retrieved from <https://www.postman.com/>

{% hint style="warning" %}
**Caution:** Before proceeding, make sure your server is running. If not, run`npm start`
{% endhint %}

Let's try to test our get call where we ask for a list of the books:

![](https://3562566727-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MJ2dzCH38HoVBUGfU0z%2F-ML9xyzedM80EjQq_33Q%2F-ML9zBKlGAjoG0iUSSck%2Fget.png?alt=media\&token=cdd0c978-0f3f-4af5-83e2-da0ceea2d9c3)

We select **GET** as request method, and we enter the URL that we previously specified in our router. As a result of sending the request (by pressing the blue button **Send**), the server returns an empty array since our database has no books yet.

The next step is therefore to create a new book:

![](https://3562566727-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MJ2dzCH38HoVBUGfU0z%2F-ML9xyzedM80EjQq_33Q%2F-MLA-CaClemEv_1Uz3Pd%2Fpost.png?alt=media\&token=8afd8eee-39b5-4910-80b8-9a52beaa1e58)

Since adding books is done through a **POST** method, we select that in Postman. Then, we specify the URL and we also provide the necessary data in the body. For that, we also have to make sure that we click on `Body`, then `raw` and finally select `JSON` as format in the drop-down list whose text is highlighted in orange.

If we try to get the list of books again, the book should be displayed.

![](https://3562566727-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MJ2dzCH38HoVBUGfU0z%2F-ML9xyzedM80EjQq_33Q%2F-MLA0CcrJAEPfIWJWt5s%2Fget%202.png?alt=media\&token=92552086-18e5-40e5-8602-d3dac7f00e47)

Finally, we can remove the book that we added. Note that we should add in the URL the ISBN of the book and select **DELETE** as the request method.

![](https://3562566727-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MJ2dzCH38HoVBUGfU0z%2F-ML9xyzedM80EjQq_33Q%2F-MLA0rvWYvZlm-ZABA6H%2Fdelete.png?alt=media\&token=3a20887e-8ab2-4b65-847b-5e0ff824cd72)
