0
0
Postmantesting~5 mins

GET request in Postman

Choose your learning style9 modes available
Introduction

A GET request asks a server to send back data. It is used to read or retrieve information without changing anything.

When you want to see a list of users from a website.
When you check the details of a product on an online store.
When you want to load a webpage or its content.
When you want to get the current weather from a weather API.
When you want to fetch data without making any changes on the server.
Syntax
Postman
GET https://api.example.com/resource
GET requests do not change data on the server.
Parameters can be added in the URL after a question mark (?).
Examples
Fetches a list of all users.
Postman
GET https://api.example.com/users
Fetches details of the user with ID 123.
Postman
GET https://api.example.com/users/123
Searches for items related to 'book'.
Postman
GET https://api.example.com/search?q=book
Sample Program

This GET request fetches the post with ID 1 from a test API. The server should return the post data without errors.

Postman
GET https://jsonplaceholder.typicode.com/posts/1

// Expected response status: 200 OK
// Expected response body contains post with id 1
OutputSuccess
Important Notes

GET requests should never be used to change data on the server.

Always check the response status code to confirm the request succeeded (usually 200).

Use query parameters to filter or search data in GET requests.

Summary

GET requests retrieve data without changing it.

Parameters can be added in the URL to specify what data to get.

Check response status and body to verify the request worked.