Building RESTful Web Services with Spring 5(Second Edition)
上QQ阅读APP看书,第一时间看更新

Testing the endpoint – createUser

As we have finished out first API implementation, we can now test it by calling the following URI in the browser:

http://localhost:8081/user

As we can't use the POST method in a browser, we will test it in a REST API client, called Postman: 

After adding the new user, you can check the results by calling the getAllUsers URI (http://localhost:8081/user).

Postman is a REST client that can be used to build, test, and share REST API calls. Tools like these will be very helpful when we test our REST API without having to write code for testing.

SoapUI is another REST client and can be used as an alternative to Postman.