When sending a request body in Postman, why must the JSON format match the API expectations exactly?
Think about how the API reads the data you send.
The API expects data in a specific JSON structure to parse it correctly. If the format is wrong, the API cannot understand the data and may return errors.
Given this API expects a JSON body with keys username and password. What response will the API return if the body is {"username": "user1"}?
Consider what happens if required fields are missing in the JSON body.
The API checks for required fields. If password is missing, it returns an error indicating the missing field.
Choose the Postman test script that correctly checks if the response JSON has a status key with value success.
Remember how to parse JSON response in Postman test scripts.
Use pm.response.json() to parse the response body as JSON. Then check the status key value.
Given this request body in Postman:
{
"user": "test",
"pass": "1234"
}The API expects keys username and password. Why does the request fail?
Check if the keys in the JSON body match what the API expects.
The API validates the JSON keys strictly. If keys differ, it returns 400 Bad Request due to invalid input.
Which approach best automates checking that the request body matches the API's expected JSON schema during Postman Collection runs?
Think about how to validate JSON structure automatically after requests.
Postman allows adding test scripts that validate response or request bodies against JSON schemas. This helps automate format validation during collection runs.