Throw generic Error Messages − A web service method should use HTTP error messages like 403 to show access forbidden etc.
What HTTP Status Code 201 states?
It means, CREATED, when a resource is successful created using POST or PUT request. Return link to newly created resource using location header.
What HTTP Status Code 204 states?
It means, NO CONTENT, when response body is empty for example, a DELETE request.
i see 200 UNKNOWN No body returned for response
What HTTP Status Code 304 states?
It means, NOT MODIFIED, used to reduce network bandwidth usage in case of conditional GET requests. Response body should be empty. Headers should have date, location etc.
What HTTP Status Code 400 states?
It means, BAD REQUEST, states that invalid input is provided e.g. validation error, missing data
What HTTP Status Code 401 states?
It means, FORBIDDEN, states that user is not having access to method being used for example, delete access without admin rights.
What HTTP Status Code 409 states?
It means, CONFLICT, states conflict situation while executing the method for example, adding duplicate entry.
From novice to tech pro — start learning today.