Test Overview
This test sends a GET request to a public API endpoint and verifies that the response status code is 200, indicating success.
This test sends a GET request to a public API endpoint and verifies that the response status code is 200, indicating success.
pm.test("Status code is 200", function () { pm.response.to.have.status(200); });
| Step | Action | System State | Assertion | Result |
|---|---|---|---|---|
| 1 | Send GET request to https://jsonplaceholder.typicode.com/posts/1 | Postman sends HTTP GET request to the API endpoint | — | PASS |
| 2 | Receive response from the API | Response received with status code 200 and JSON body | — | PASS |
| 3 | Run test script to check status code | Test script executed in Postman test tab | Verify response status code equals 200 | PASS |
GET request in Postman?https://api.example.com/users/1 in Postman. The response body is {"id":1,"name":"Alice"} and status code is 200. What does this mean?Pass the test and this pattern moves unknown