Validate API status codes, headers and response time
Get help with your first test →
A visible response is not yet a repeatable test. Status, headers and content can fail independently.
Prepare an HTTP run
Create a request to a test API or mock and select its test cases. Status and headers come from response metadata. A JSON document pasted for analysis does not include that metadata.
Assert the status
Use the HTTP status assertion with the contract value. Reading a resource may return 200 while creating one may require 201. Treat all 2xx values as equivalent only when the contract allows it.
Assert headers and content
Use the response header assertion for Content-Type, accounting for permitted charset parameters. Use the JSON response field assertion for a business value. Frontend and backend contracts may distinguish the string "2" from the number 2.
Set a time threshold
A response time assertion compares milliseconds against your limit. The 1000 ms example is not a universal SLA. Network and environment affect duration. A single request cannot establish throughput or load behavior.
expected status = 200
Content-Type contains application/json
response time <= 1000 msCheck browser-specific behavior
Desktop success does not prove that a browser will allow the same call under CORS. Inspect browser console errors, cookies and the environment separately. This helps distinguish API behavior from frontend restrictions.
Start with the linked example and compare its result with your own test requirement.