Basics of API Testing Using Postman
APIs(Application Programming Interfaces) are very commonly used in development. Postman is a tool that can be used for API Testing. In this article, we will learn how to do simple API Testing using Postman.
- Go to your workspace in Postman.
- Click on the + symbol to open a new tab.
- Enter the API Endpoint where it says, “Enter request URL” and select the method (action type GET, POST, etc.) for that request as shown below.
- Click on the Send button.
Now as you can see in the tab below, the response received from the API is shown along with the status 200 which implies that the request has succeeded.
For a post method, you can also specify the body of the request in any of the formats listed.
- Select method as POST and write the request URL.
- In this example, we will be sending request data in JSON format. For this, Go to Body and select raw from the radio buttons listed. Then, select JSON.
- Write the request body(you can also enter headers if required) and hit Send.
As you can see in the image above, status 201 is received implying that the request was successful and the resource has been created. More information related to the API call can be found under the “Headers”. You can also save the request by clicking on the save button and adding it to a collection in Postman.
Whether you're preparing for your first job interview or aiming to upskill in this ever-evolving tech landscape, GeeksforGeeks Courses
are your key to success. We provide top-quality content at affordable prices, all geared towards accelerating your growth in a time-bound manner. Join the millions we've already empowered, and we're here to do the same for you. Don't miss out - check it out now!