Script Valley
Postman API Testing: Complete Course
Making API Requests in PostmanLesson 2.1

Sending GET and POST Requests in Postman

GET request, POST request, query parameters, path parameters, request body, JSON body, Content-Type header, JSONPlaceholder

Sending GET and POST Requests in Postman

Postman API testing becomes practical the moment you start sending real HTTP requests. GET and POST are the two most frequently used HTTP methods in REST API testing โ€” GET retrieves data and POST creates new resources. Mastering these two methods with Postman gives you the foundation for all other API testing work.

Sending a GET Request

GET requests retrieve data from a server. They have no request body and all parameters are passed in the URL. In Postman:

  • Select GET from the method dropdown.
  • Enter the URL: https://jsonplaceholder.typicode.com/posts
  • Click Send. You will receive an array of 100 post objects in JSON format.

To filter with query parameters, click the Params tab and add key-value pairs:

Key: userId    Value: 1
Key: _limit    Value: 5

Postman appends these automatically, making the URL: https://jsonplaceholder.typicode.com/posts?userId=1&_limit=5

Path Parameters

Path parameters are part of the URL structure itself, not appended as query strings. To fetch a specific post:

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

Postman supports dynamic path parameters using the colon syntax. You can write the URL as https://jsonplaceholder.typicode.com/posts/:postId and then set postId in the Params tab. This makes the request reusable for any post ID.

Sending a POST Request

POST requests create new resources. They require a request body containing the data to be created. In Postman:

  • Select POST from the method dropdown.
  • Enter the URL: https://jsonplaceholder.typicode.com/posts
  • Click the Body tab.
  • Select raw and choose JSON from the format dropdown.
  • Enter your JSON payload:
{
  "title": "My First Post",
  "body": "This is the content of the post.",
  "userId": 1
}
  • Click Send. The server returns a 201 Created status with the new resource including a generated ID.

Setting Content-Type Header

When you select raw JSON in the Body tab, Postman automatically sets the Content-Type header to application/json. You can verify this in the Headers tab. If you ever need to send XML, change both the Body format and the Content-Type header to application/xml.

Reading the Response

After sending a POST request to JSONPlaceholder, you should see:

{
  "id": 101,
  "title": "My First Post",
  "body": "This is the content of the post.",
  "userId": 1
}

The status code 201 Created confirms success. The id field (101) was assigned by the server. Note that JSONPlaceholder is a mock API โ€” it does not actually persist data, but it simulates the correct behavior for learning purposes.

Common GET Request Mistakes

  • Sending a GET with a request body โ€” most servers ignore it, but it is not RESTful practice.
  • Putting authentication credentials in the URL as query params โ€” always use the Authorization header instead.
  • Not URL-encoding special characters in query param values โ€” Postman handles this automatically, but be aware of it.

Key Takeaways

  • GET retrieves data โ€” use Params tab for query string and path parameters.
  • POST creates resources โ€” always set the Body to raw JSON and verify Content-Type is application/json.
  • 201 Created is the correct success status for POST. 200 OK is correct for GET.
  • JSONPlaceholder (jsonplaceholder.typicode.com) is a free mock API perfect for practicing Postman requests.

Up next

PUT, PATCH, and DELETE Requests in Postman

Sign in to track progress

Sending GET and POST Requests in Postman โ€” Making API Requests in Postman โ€” Postman API Testing: Complete Course โ€” Script Valley โ€” Script Valley