Software & ToolsTech & Platforms

A Step by Step Guide to Manual Web API Testing with Postman

Whether you are a developer, tester, or manager, understanding different API methods can sometimes be a challenge when building and consuming applications. Creating good documentation and help pages for a Web API using Postman provides an easy way to execute and review HTTP requests.

Below is a step-by-step guide on how to test various methods (GET, POST, PUT, and DELETE) using Postman:

Initial Preparation

  1. First, download and install the Postman application, which is used for testing API requests.
  2. Prepare the base address (local port number) for your project (note that your local port may vary depending on your project configuration).
  • http://localhost:your_port/api/GetAllTodos // GET
  • http://localhost:your_port/api/AddTodo // POST
  • http://localhost:your_port/api/UpdateTodo // PUT
  • http://localhost:your_port/api/DeleteTodo/5 // DELETE

1. Testing the GET Method with Postman

  1. Set the HTTP action from the drop-down list to GET.
  2. Enter the API URL for retrieving data (e.g., GetAllTodos) in the appropriate field.
  3. Click the blue Send button.
  4. If the request is successful, the 200 OK status along with the returned data will be displayed.

2. Testing the POST Method with Postman

  1. Set the HTTP action from the drop-down list to POST.
  2. Enter the URL for adding data (e.g., AddTodo) in the API URL field.
  3. Since this API accepts a new object in JSON format, select the Body tab.
  4. Check the raw option.
  5. Set the text format to JSON (application/json).
  6. Write or paste your target JSON data.
  7. Click the blue Send button.
  8. If successful, the 200 OK status along with the returned value will be shown in the response body.

3. Testing the PUT Method with Postman

  1. Set the HTTP action from the drop-down list to PUT.
  2. Enter the URL for updating data (e.g., UpdateTodo) in the URL field.
  3. To send edited information in JSON format, select the Body tab and check the raw option.
  4. Set the text format to JSON (application/json).
  5. Write or paste the JSON data containing the updated information.
  6. Click the blue Send button.
  7. If the operation is successful, the 200 OK status and the updated result will be visible in the Body tab.

4. Testing the DELETE Method with Postman

  1. Set the HTTP action from the drop-down list to DELETE.
  2. Enter the URL for deletion along with the target identifier (e.g., DeleteTodo/5) in the API URL field.
  3. Click the blue Send button.
  4. If the deletion operation completes successfully, you will receive a 200 OK status.

This tutorial covered the first part of manual testing with Postman. Future parts can explore automated testing and writing scripts for integration test cases.

#Postman #API #WebAPI #Testing #Automation

Tags
Show More

IoT Journal

Technical Product Manager focused on enterprise IoT and digital transformation.

Related Articles

Leave a Reply

Your email address will not be published. Required fields are marked *

Back to top button
Close