Now, click on raw and select JSON (application/json) from the type drop down menu as marked in the screenshot below.įinally, type in the information of the Hero you want to insert in JSON format and click on Send.Īs you can see, the Hero is inserted with the id 21.Īll you API requests you make is saved in the history of Postman. To create a new hero, set method to POST and the API endpoint to /api/heroes Then, click on Body as marked in the screenshot below. I set up my API server in a way that it creates a new Hero on POST request. You can also do a POST request on your API server using Postman. Once you press Send, the output should be displayed in JSON format as you can see in the screenshot below. If you want to perform a GET request on your API, type in the URL of your API endpoint, set the method to GET, and finally click on Send.įor example, to get a list of all the heroes in the database, do a GET request to the API server’s /api/heroes endpoint. You will see how everything works in the next section of this article. Once, you’re done, click on Send to send your API request. You can select the request method (such as GET, POST, PUT etc) from the drop down menu as marked in the screenshot below. You can type in the URL of your API endpoint in the marked section of the screenshot below. If you want to follow along, you can just clone my GitHub repository angular-hero-api and run the same API server as I am.Ĭlone my GitHub repository with the following command:Īs you can see, the API server is running on port 4242.įirst, open Postman and it should look something like this.
I’ve written a API using Node.js which I will be using in this article to show you how to use Postman to test APIs.
You can also install Postman natively on Linux. Click on the link as marked in the screenshot below if you don’t have an account or you don’t want to login. If you open Postman for the first time, you should see the following window. Now you can click on Launch app to start Postman. In this section, I will show you how to install Postman from the Chrome Web Store.įirst, go to the Postman extension page on Chrome Web Store at Installing Postman as a Chrome Extension: In this article, I will show you how to test REST API using Postman. I will use the free version in this article. You can do almost everything with the free version. Postman has a free version and paid versions. So, you can use Postman inside your Google Chrome browser. Postman is also available as a Chrome plugin. Postman is available for Windows, Mac and Linux. It also has many helpful features to help you with testing your REST API.
Postman has an easy to use graphical user interface.
Postman is a software which you can use to test REST APIs.