Bird
Raised Fist0
Postmantesting~20 mins

GET request in Postman - Practice Problems & Coding Challenges

Choose your learning style10 modes available
Challenge - 5 Problems
🎖️
GET Request Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
❓ Predict Output
intermediate
2:00remaining
What is the status code returned by this GET request?
You send a GET request to https://jsonplaceholder.typicode.com/posts/1 using Postman. What status code do you expect in the response?
Postman
GET https://jsonplaceholder.typicode.com/posts/1
A500
B404
C301
D200
Attempts:
2 left
💡 Hint
A successful GET request usually returns this status code.
❓ assertion
intermediate
2:00remaining
Which assertion correctly verifies the response body contains a userId of 1?
You receive this JSON response from a GET request:
{"userId": 1, "id": 1, "title": "...", "body": "..."}

Which Postman test script assertion correctly checks that userId equals 1?
Apm.test('UserId is 1', () => { pm.expect(pm.response.json().userId).to.eql(1); });
Bpm.test('UserId is 1', () => { pm.expect(pm.response.userId).to.equal(1); });
Cpm.test('UserId is 1', () => { pm.expect(pm.response.json().userId).to.be(1); });
Dpm.test('UserId is 1', () => { pm.expect(pm.response.body.userId).to.eql(1); });
Attempts:
2 left
💡 Hint
Use pm.response.json() to parse JSON response body.
🔧 Debug
advanced
2:00remaining
Why does this Postman test fail with 'TypeError: Cannot read property'?
Test script:
pm.test('Title exists', () => { pm.expect(pm.response.body.title).to.exist; });

What causes the error?
Postman
pm.test('Title exists', () => { pm.expect(pm.response.body.title).to.exist; });
AThe test script is missing a semicolon causing syntax error.
Bpm.response.body is a string, not an object, so accessing .title causes TypeError.
Cpm.response.body is undefined because the request failed.
DThe assertion method 'to.exist' is invalid and causes the error.
Attempts:
2 left
💡 Hint
Check the type of pm.response.body before accessing properties.
🧠 Conceptual
advanced
2:00remaining
What is the main difference between GET and POST requests in API testing?
Choose the best explanation for the difference between GET and POST requests.
AGET requests send data in the request body; POST requests send data in the URL.
BGET requests always require authentication; POST requests never do.
CGET requests retrieve data without changing server state; POST requests send data to create or update resources.
DGET requests are slower than POST requests because they transfer more data.
Attempts:
2 left
💡 Hint
Think about what each request type is used for in APIs.
❓ framework
expert
2:00remaining
Which Postman test script correctly checks that the response header 'Content-Type' includes 'application/json'?
You want to verify the response header 'Content-Type' contains 'application/json'. Which script is correct?
Apm.test('Content-Type is JSON', () => { pm.expect(pm.response.headers.get('Content-Type')).to.include('application/json'); });
Bpm.test('Content-Type is JSON', () => { pm.expect(pm.response.headers['Content-Type']).to.equal('application/json'); });
Cpm.test('Content-Type is JSON', () => { pm.expect(pm.response.headers.get('content-type')).to.eql('application/json'); });
Dpm.test('Content-Type is JSON', () => { pm.expect(pm.response.headers['content-type']).to.include('application/json'); });
Attempts:
2 left
💡 Hint
Use the correct method to get headers in Postman scripts and check inclusion.

Practice

(1/5)
1. What is the main purpose of a GET request in Postman?
easy
A. To delete data from the server
B. To retrieve data from a server without changing it
C. To update existing data on the server
D. To send data to a server to create a new resource

Solution

  1. Step 1: Understand HTTP methods

    GET requests are designed to fetch or retrieve data from a server without modifying it.
  2. Step 2: Compare with other methods

    POST creates, PUT updates, DELETE removes data, so they are not for just retrieving data.
  3. Final Answer:

    To retrieve data from a server without changing it -> Option B
  4. Quick Check:

    GET = retrieve data [OK]
Hint: GET always fetches data, never changes it [OK]
Common Mistakes:
  • Confusing GET with POST or PUT methods
  • Thinking GET can modify data
  • Assuming GET deletes data
2. Which of the following is the correct way to add query parameters to a GET request URL in Postman?
easy
A. https://api.example.com/data?user=123&active=true
B. https://api.example.com/data/user=123&active=true
C. https://api.example.com/data#user=123&active=true
D. https://api.example.com/data/user/123/active/true

Solution

  1. Step 1: Identify query parameter syntax

    Query parameters start with a question mark (?) and separate key-value pairs with ampersands (&).
  2. Step 2: Check each URL format

    https://api.example.com/data?user=123&active=true uses ? and & correctly; others use incorrect separators or path segments.
  3. Final Answer:

    https://api.example.com/data?user=123&active=true -> Option A
  4. Quick Check:

    Query params start with ? and use & [OK]
Hint: Use ? for first param, & for others in URL [OK]
Common Mistakes:
  • Using slashes instead of ? and & for parameters
  • Using # which is for fragments, not parameters
  • Omitting the question mark before parameters
3. Given this GET request in Postman:
GET https://api.example.com/users?id=5

What is the expected status code if the user with id 5 exists?
medium
A. 404 Not Found
B. 500 Internal Server Error
C. 200 OK
D. 301 Moved Permanently

Solution

  1. Step 1: Understand HTTP status codes

    200 OK means the request succeeded and data is returned.
  2. Step 2: Match status with scenario

    If user id 5 exists, server returns 200 OK with user data; 404 means not found, 500 is server error, 301 is redirect.
  3. Final Answer:

    200 OK -> Option C
  4. Quick Check:

    Existing data returns 200 OK [OK]
Hint: 200 means success, 404 means missing data [OK]
Common Mistakes:
  • Confusing 404 with 200
  • Thinking 500 means data not found
  • Assuming 301 is success status
4. You send a GET request in Postman but receive a 400 Bad Request error. What is the most likely cause?
medium
A. The URL has incorrect or malformed query parameters
B. The server is down and not responding
C. The requested resource does not exist
D. The request method should be POST instead of GET

Solution

  1. Step 1: Understand 400 Bad Request meaning

    400 means the server could not understand the request due to invalid syntax.
  2. Step 2: Analyze causes

    Malformed query parameters cause bad syntax; server down causes no response (timeout), resource missing causes 404, wrong method causes 405.
  3. Final Answer:

    The URL has incorrect or malformed query parameters -> Option A
  4. Quick Check:

    400 = bad syntax in request [OK]
Hint: 400 means bad request syntax, check URL parameters [OK]
Common Mistakes:
  • Confusing 400 with server down errors
  • Assuming 400 means resource missing
  • Thinking method mismatch causes 400
5. You want to test a GET request in Postman that retrieves a list of products filtered by category and sorted by price ascending. Which URL format correctly applies both filters?
hard
A. https://api.example.com/products?category=electronics&sort=price-desc
B. https://api.example.com/products/category=electronics/sort=price_asc
C. https://api.example.com/products?category=electronics#sort=price_asc
D. https://api.example.com/products?category=electronics&sort=price_asc

Solution

  1. Step 1: Use correct query parameter syntax

    Parameters start with ? and separate keys with &. The keys and values must match expected API parameters.
  2. Step 2: Check parameter values for sorting

    https://api.example.com/products?category=electronics&sort=price_asc uses 'sort=price_asc' which clearly means ascending price. https://api.example.com/products?category=electronics&sort=price-desc uses 'price-desc' which is descending, not ascending.
  3. Final Answer:

    https://api.example.com/products?category=electronics&sort=price_asc -> Option D
  4. Quick Check:

    Use ? and & with correct param names and values [OK]
Hint: Use ? then & for multiple filters with correct values [OK]
Common Mistakes:
  • Using # instead of & for parameters
  • Mixing path segments with query parameters
  • Using wrong sort value (desc instead of asc)
Recommended

Ready to prove it?

Pass the test and this pattern moves unknown strong while earning +1 Grip toward your certificate.

10 questions~5 mineasy hard