Activity 24: POSTMAN


Postman is a tool that helps developers test and troubleshoot APIs (Application Programming Interfaces). With Postman, you can create, send, and receive HTTP requests, which is essential for testing the functionality of APIs.

How to install Postman?

Postman can be downloaded and installed for free from the Postman website. Follow the steps below to download and install Postman on your computer:

  1. Go to the Postman website at https://www.postman.com/downloads/.

  2. Click on the “Download” button for the version of Postman you want to install (Windows, Mac, or Linux).

  3. Once the download is complete, open the installation file and follow the on-screen instructions to install Postman on your computer.


Installing Postman:

Create Account to Log in:

Open the App:

Once Installed; allow access in your computer.

The App is ready to use:


How to use Postman?

Step 1: Create a new request

To create a new request, click on the New button in the top left corner of the screen. This will open a new tab where you can start building your request.


Step 2: Choose the request method and enter the API endpoint URL

sample URL: http://postman-echo.com

Choose the request method (GET, POST, PUT, DELETE) from the drop-down menu and enter the API endpoint URL in the address bar.

Step 3: Add headers, parameters, and other request details

If your API requires additional headers or parameters, you can add them in the Headers and Params tabs respectively. You can also add a request body in the Body tab.


Step 4: Click on the “Send” button

Once you have added all the necessary details to your request, click on the Send button to send the request to the API server.

Step 5: View the response

After sending the request, you will see the response from the API server in the Response section. You can view the response body, headers and other details in this section.

GET:

{
    "args": {},
    "headers": {
        "host": "postman-echo.com",
        "x-request-start": "t=1728697610.024",
        "connection": "close",
        "x-forwarded-proto": "http",
        "x-forwarded-port": "80",
        "x-amzn-trace-id": "Root=1-6709d50a-7dee483c2fc048130f89fc5f",
        "user-agent": "PostmanRuntime/7.42.0",
        "accept": "*/*",
        "postman-token": "4a482a46-4d65-4f55-a0d5-04bb98635f1c",
        "accept-encoding": "gzip, deflate, br",
        "cookie": "sails.sid=s%3ASlxfRPlGwjOSRb-B98egO08gdoqSnOyS.gwa75Ha7%2BRfXEmamLrFeiRAfY3NLKxPk1fyQuCBksCY"
    },
    "url": "http://postman-echo.com/get"
}

POST:

{
    "args": {},
    "data": {
        "title": "Hello World",
        "body": "This is a test POST request.",
        "userId": 1
    },
    "files": {},
    "form": {},
    "headers": {
        "host": "postman-echo.com",
        "x-request-start": "t=1728698009.777",
        "connection": "close",
        "content-length": "97",
        "x-forwarded-proto": "http",
        "x-forwarded-port": "80",
        "x-amzn-trace-id": "Root=1-6709d699-3030b6eb0819962215be1c0a",
        "content-type": "application/json",
        "user-agent": "PostmanRuntime/7.42.0",
        "accept": "*/*",
        "postman-token": "29caeeb4-8746-4834-9467-340926f2486f",
        "accept-encoding": "gzip, deflate, br",
        "cookie": "sails.sid=s%3Abo2lu_dhIDm3mrap9e4nDjB_aTDjzTNL.mxmhbrDo7Y%2BTjdrPI6lDd9GgqBhfbrAjyA16EhDXS7k"
    },
    "json": {
        "title": "Hello World",
        "body": "This is a test POST request.",
        "userId": 1
    },
    "url": "http://postman-echo.com/post"
}

PUT:

{
    "args": {},
    "data": {
        "id": 1,
        "title": "Updated Title",
        "body": "This is an updated test PUT request.",
        "userId": 1
    },
    "files": {},
    "form": {},
    "headers": {
        "host": "postman-echo.com",
        "x-request-start": "t=1728698169.007",
        "connection": "close",
        "content-length": "123",
        "x-forwarded-proto": "http",
        "x-forwarded-port": "80",
        "x-amzn-trace-id": "Root=1-6709d739-2d2362e60fa3b3550391ab69",
        "content-type": "application/json",
        "user-agent": "PostmanRuntime/7.42.0",
        "accept": "*/*",
        "postman-token": "3e1c82ce-9de2-44c9-9cd3-17c7d1e48869",
        "accept-encoding": "gzip, deflate, br",
        "cookie": "sails.sid=s%3AjblUz_9yjKGtQ7-_rDKJofAshY_G3Xj-.977ILtzaRlihZoMGyFh9DvL9EauScY19ZZXgbSCixb8"
    },
    "json": {
        "id": 1,
        "title": "Updated Title",
        "body": "This is an updated test PUT request.",
        "userId": 1
    },
    "url": "http://postman-echo.com/put"
}

DELETE:

{
    "args": {
        "id": "1\n"
    },
    "data": {
        "id": 1,
        "title": "Updated Title",
        "body": "This is an updated test PUT request.",
        "userId": 1
    },
    "files": {},
    "form": {},
    "headers": {
        "host": "postman-echo.com",
        "x-request-start": "t=1728698427.466",
        "connection": "close",
        "content-length": "123",
        "x-forwarded-proto": "http",
        "x-forwarded-port": "80",
        "x-amzn-trace-id": "Root=1-6709d83b-42076fc95e02f9b62330da79",
        "content-type": "application/json",
        "user-agent": "PostmanRuntime/7.42.0",
        "accept": "*/*",
        "postman-token": "8a9e2703-9791-4afe-8be5-9a62ab301638",
        "accept-encoding": "gzip, deflate, br",
        "cookie": "sails.sid=s%3AF57ewddgr8iDdk5iQ-r9AISu6u43iXgd.Lx%2F844ANB0IKP0fR8Pw13syDVTeGhixM25OvTPudabw"
    },
    "json": {
        "id": 1,
        "title": "Updated Title",
        "body": "This is an updated test PUT request.",
        "userId": 1
    },
    "url": "http://postman-echo.com/delete?id=1%0A"
}

Conclusion

Postman plays a crucial role in modern software development by simplifying the process of working with APIs. Its features cater to the needs of developers, testers, and organizations, promoting collaboration, automation, and efficiency throughout the development lifecycle. Whether you're building, testing, or documenting APIs, Postman is an invaluable tool that can enhance productivity and streamline workflows.


1
Subscribe to my newsletter

Read articles from Danilo Buenafe Jr directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Danilo Buenafe Jr
Danilo Buenafe Jr