What is the main purpose of a DELETE request in API testing?
Think about which HTTP method is used to remove something.
A DELETE request is used to remove a resource from the server. It tells the server to delete the specified data.
What is the typical HTTP status code returned after a successful DELETE request?
Successful DELETE usually returns a status indicating success without creating anything new.
A successful DELETE request usually returns 200 OK or 204 No Content. 200 OK means the request succeeded and the server returns a response body.
Which Postman test script assertion correctly verifies a successful DELETE request?
pm.test("Status code is 200", () => { pm.response.to.have.status(200); });
Check for the status code that indicates success for DELETE.
The assertion checks that the response status code is 200, which means the DELETE request succeeded.
You send a DELETE request in Postman but receive a 405 Method Not Allowed error. What is the most likely cause?
405 means the method is not allowed on the resource.
A 405 error means the server understands the request method but does not allow it for the requested URL. This usually means DELETE is not supported there.
In an automated test framework using JavaScript and Postman, which code snippet correctly sends a DELETE request and asserts the response status is 204?
const pm = require('postman-collection');
// Example snippetDELETE requests often return 204 No Content on success.
The snippet sends a DELETE request and asserts the response status is 204, which means the resource was deleted successfully with no content returned.