Activity #24: Postman

·

3 min read

A step-by-step guide on how to install Postman and how to use it. (PUT, GET, DELETE, POST).

  • In your browser search a Postman then click it. https://www.postman.com/downloads/ here is the link to get a link for postman.

  • Check if you are windows 64 then you are eligible to install it.

  • Wait for a few minutes.

  • When it successfully install click the file

  • When the installation is done, You will see the homepage of postman that you installed.

  • If you don’t have an account you can create a new account.

  • Then enter your name and role, click continue and you can collaborate with others in postman.

  • After that you are done

How to use PUT, DELETE, GET POST.

In this article, we are going to learn how can we send different types of requests like GET, POST, PUT, and DELETE in the Postman. Postman is a popular API testing tool that is used to simplify the process of developing and testing APIs (Application Programming Interface). API acts as a bridge between two software applications which enables them to communicate and share data. Postman provides a simple Graphical User Interface for sending HTTP requests Like GET, POST, Put, Delete, and viewing their responses.

  • GET: Used to retrieve information from the given server using a given URI. GET requests should only retrieve data and have no other effect on the data.

  • POST: Sends data to a server to create or update a resource. The data is included in the body of the request. This may be a JSON payload, form data, or file.

  • PUT: Replaces all current representations of the target resource with the uploaded content. It’s used to update existing resources.

  • DELETE: Removes the specified resource from the server.

How to send a GET request

  • Step 1: In Postman, from the collection add a new request and give a name get users. For this, we will be using the demo API to test the different types of requests.

  • Step 2: Select the GET method from the dropdown.

  • Step 3: Enter the URL of the API endpoint you wish to query.

  • Step 4: Click ‘Send’. The server’s response will be displayed in the lower pane.

    Screenshot-2023-12-26-151039

How to send a POST request

  • Step 1: Create a new request as before.

  • Step 2: Select POST from the method dropdown.

  • Step 3: Enter the API endpoint URL.

  • Step 4: Under the ‘Body’ tab, choose a format (e.g., form-data, x-www-form-urlencoded, raw (JSON, text, JavaScript, etc.))

  • Step 5: Enter the data you wish to send and click ‘Send’.

  • Screenshot-2023-12-26-152702

How to send PUT request

PUT requests are used to update existing data on the server. Follow the same steps as the POST request, but select PUT as the method.

Example: Ensure the URL and body data are appropriate for updating data.

Screenshot-2023-12-26-153431

How to send a DELETE request

To delete data, use the same endpoints with an item ID.

Example: Send a DELETE request to jsonplaceholder.typicode.com/posts/1 to delete the post with ID 1.

Screenshot-2023-12-26-162657