Challenge - 5 Problems
GET Request Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
❓ Predict Output
intermediate2: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/1Attempts:
2 left
💡 Hint
A successful GET request usually returns this status code.
✗ Incorrect
A GET request to a valid resource typically returns status code 200, meaning success.
❓ assertion
intermediate2:00remaining
Which assertion correctly verifies the response body contains a userId of 1?
You receive this JSON response from a GET request:
Which Postman test script assertion correctly checks that userId equals 1?
{"userId": 1, "id": 1, "title": "...", "body": "..."}Which Postman test script assertion correctly checks that userId equals 1?
Attempts:
2 left
💡 Hint
Use pm.response.json() to parse JSON response body.
✗ Incorrect
Option A correctly parses the JSON response and uses to.eql(1) to assert equality.
Other options either access wrong properties or use invalid assertion methods.
🔧 Debug
advanced2:00remaining
Why does this Postman test fail with 'TypeError: Cannot read property'?
Test script:
What causes the error?
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; });Attempts:
2 left
💡 Hint
Check the type of pm.response.body before accessing properties.
✗ Incorrect
pm.response.body is a raw string, so accessing .title directly causes a TypeError.
Use pm.response.json() to parse the body first.
🧠 Conceptual
advanced2: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.
Attempts:
2 left
💡 Hint
Think about what each request type is used for in APIs.
✗ Incorrect
GET requests are used to fetch data without side effects.
POST requests send data to the server to create or update resources.
❓ framework
expert2: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?
Attempts:
2 left
💡 Hint
Use the correct method to get headers in Postman scripts and check inclusion.
✗ Incorrect
Option A uses pm.response.headers.get() which is the correct way to access headers.
It also uses to.include() to check substring presence.
Other options either use wrong access or wrong assertion methods.