# Activity 24: POSTMAN

### What is postman and its uses?

Postman is one of the most popular software testing tools which is used for API testing. With the help of this tool, developers can easily create, test, share, and document APIs.

* Postman is a standalone software testing API (Application Programming Interface) platform to build, test, design, modify, and document APIs. It is a simple Graphic User Interface for sending and viewing HTTP requests and responses.
    
* While using Postman, for testing purposes, one doesn't need to write any HTTP client network code. Instead, we build test suites called collections and let Postman interact with the API.
    
* In this tool, nearly any functionality that any developer may need is embedded. This tool has the ability to make various types of HTTP requests like GET, POST, PUT, PATCH, and convert the API to code for languages like JavaScript and Python.
    

## **Why use Postman?**

Postman is based on a wide range of extremely user-friendly power tools. For more than 8 million users, Postman has become a tool of convenience. Following are the reasons why Postman is used:

1. **Accessibility-** One can use it anywhere after installing Postman into the device by simply logging in to the account.
    
2. **Use Collections**\-Postman allows users to build collections for their API-calls. Every set can create multiple requests and subfolders. It will help to organize the test suites.
    
3. **Test development-** To test checkpoints, verification of successful HTTP response status shall be added to every API- calls.
    
4. \*\*Automation Testing-\*\*Tests can be performed in several repetitions or iterations by using the Collection Runner or Newman, which saves time for repeated tests.
    
5. **Creating Environments-** The design of multiple environments results in less replication of tests as one can use the same collection but for a different setting.
    
6. **Debugging-** To effectively debug the tests, the postman console helps to track what data is being retrieved.
    
7. **Collaboration-** You can import or export collections and environments to enhance the sharing of files. You may also use a direct connection to share the collections.
    
8. \*\*Continuous integration-\*\*It can support continuous integration.
    

**REF:** [**https://www.javatpoint.com/postman-installation-and-updates**](https://www.javatpoint.com/postman-installation-and-updates)

## How to Download Postman?

**1st step:** Go this link

[https://www.postman.com/downloads/](https://www.postman.com/downloads/)

**2nd step:**

Then you will be redirected to their homepage and this is what you’ll see. Click the `windows 64-bit` if your computer is 64 bit and change it if not.

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1728697351696/04004f6e-d538-4586-84ff-0e785710f927.png align="center")

**3rd step:** After you click that button this is what you’re going to see. A promt that its currently downloading and you can check the download process at the top right corner next to our profile icon.

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1728697483042/e9de419b-d343-4edc-8458-56e79ed8f680.png align="center")

**4th step:** Once you’re done downloading open downloads in your document and then click the `postman.exe` and it will be installed.

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1728697711105/f5423185-4f6f-4e5b-bba5-f3e144bbc0e3.png align="center")

**5th step:** After clicking the `postman.exe` they will ask you to login or sign up. just do it.

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1728697751166/8118dd18-86de-4577-adaa-dc01192be451.png align="center")

**6th step:** so since I dont have postman account I created a free account and I’m redirected here. I just used my email for my account.

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1728697910433/3ebd8f91-09ca-4c95-82ae-5748a31802ec.png align="center")

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1728697965385/deaffff1-9b11-4633-8594-23e4bd1860d8.png align="center")

**OUTPUT:**

And here I’m don downloading and installing the postman.

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1728698041768/aeaaae15-4f70-411e-9ce3-bd679a3237bc.png align="center")

# How to use postman?

### 1\. **GET Request**

* **Purpose**: Retrieve data from the server.
    
* **Steps**:
    
    1. Open Postman and create a new request by clicking on "New" at the top left corner and select HTTP Request.
        
        ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1728702279171/bda8078f-6793-46b1-b929-1112b7a893cb.png align="center")
        
        ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1728702366331/86938af6-ee81-4b57-ad1e-b29362167d3f.png align="center")
        
    2. Select **GET** from the dropdown menu next to the request URL field.
        
        ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1728702389202/467ef597-cbc8-461f-bd5f-7fc4158d7715.png align="center")
        
    3. Enter the URL of the API you want to request. In my case I use the pokemon API
        
        ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1728702491025/5870c230-20c0-43ea-8018-8add21e22ee5.png align="center")
        
    4. If the API requires parameters, add them in the **Params** tab.
        
    5. Click **Send** to execute the request and view the response in the **Response** section
        
        ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1728702602240/bfcc785f-652a-4da7-8a35-6fbb73273d7c.png align="center")
        

### **PUT Request**

* **Purpose**: Update existing data on the server.
    
* **Steps**:
    
    1. Create a new request and select **PUT** from the dropdown.
        
        ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1728702984069/14168f14-bcd0-4845-a8c9-7517a44b0de9.png align="center")
        
    2. Enter the API URL (usually includes an ID of the resource you're updating).
        
        ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1728703034372/de3f0914-4eb3-4ddd-b145-cfbea8ef9e26.png align="center")
        
    3. Go to the **Body** tab, select the appropriate body format (JSON).
        
        ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1728703193809/94089062-688d-49ed-ad12-34e9294789fc.png align="center")
        
    4. Enter the updated data you want to send.
        
        ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1728703408644/62f08489-cbff-4c33-8c09-fa2c3f1fcb1c.png align="center")
        
    5. Click **Send** to update the resource.
        
        ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1728703448524/d2ce68cc-63f5-4013-b48a-adeacff322bd.png align="center")
        

### **POST Request**

* **Purpose**: Send data to the server (e.g., for creating a new resource).
    
* **Steps**:
    
    1. Create a new request and choose **POST** from the dropdown.
        
        ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1728797287984/46b01d5f-8e2a-4abd-b8fc-97d04d60214c.png align="center")
        
    2. Enter the URL of the API.
        
        ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1728797848205/bcdbef28-6ecd-49b5-99a9-49364b5e41f8.png align="center")
        
    3. Go to the **Body** tab and select **raw** or **form-data** based on the format your API expects (e.g., JSON, text, etc.).
        
        ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1728797874423/22cd9b35-7b61-42c9-9733-ca80488445c8.png align="center")
        
    4. Type the data you want to send in the body (for JSON, select JSON from the dropdown).
        
        ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1728797934269/ca0761a8-7ec2-4f75-8fd5-efe24511b781.png align="center")
        
    5. Click **Send** to submit the data.
        
        ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1728797955251/f36b96a7-066b-4b0b-8a39-5c0d2cf96d7b.png align="center")
        

### DELETE Request

* * **Purpose**: Delete a resource on the server.
        
    * **Steps**:
        
        1. Create a new request and choose **DELETE**.
            
            ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1728798162263/47fe861b-fcbd-4543-b698-9d31b3cacfd9.png align="center")
            
        2. Enter the URL of the resource to delete (typically includes an ID in the URL).
            
            ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1728798245038/8d0ac281-e8f4-49ea-beed-4fc15a80f30d.png align="center")
            
        3. Click **Send** to delete the resource. Since the response is `200 OK` there there’s empty curly braces it means that the delete was successful.
            
    
    ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1728798271484/504aee0a-0ac0-4fc9-ada4-7db33b63cd9c.png align="center")
