We will now look at how to test our API by using the Postman client. You can also use any other REST client that you are comfortable with:
- Search for Postman Chrome extension, and follow the search results to install the Postman extension in Chrome.
Postman is also available as a native app, to download, install, and use. It will also be the preferred way to use the Postman client, from this point forward.
- Once Postman has been added as an extension in Chrome, you can launch it from chrome://apps/. You can log in to your Google account, or skip logging in.
- Select the Request option. You can specify a folder to save the request in, or close the Save dialog box.
- Configure Postman to send requests to our API method, and click on Send:
- Select the POST method.
- Add our endpoint URL for the POST method.
- Go to the Body tab, click on raw, and select JSON (application/json) for the content type.
- Add our JSON payload, as follows:
- Once you have configured the options and have clicked on send, you should get a successful response, as follows: