Complete the code to set the HTTP status code for an error response.
response.status_code = [1]The status code 500 indicates an internal server error, which is commonly used for error responses.
Complete the JSON error response body with the correct key for the error message.
{
"error": {
"[1]": "Resource not found"
}
}The key message is commonly used to describe the error details in the response body.
Fix the error in the error response JSON by completing the missing key for the error code.
{
"error": {
"[1]": 404,
"message": "Not Found"
}
}The key code is the standard way to represent the error code in many APIs.
Fill both blanks to create a complete error response with status and message keys.
{
"error": {
"[1]": 401,
"[2]": "Unauthorized access"
}
}The status key holds the error code, and message holds the error description.
Fill all three blanks to create a detailed error response with code, message, and details keys.
{
"error": {
"[1]": 403,
"[2]": "Forbidden",
"[3]": "You do not have permission to access this resource."
}
}The code key holds the error number, message gives a short description, and details provides more information.