Bird
0
0

Which of the following is the correct way to respond with a 400 Bad Request status in a REST API using HTTP headers?

easy📝 Syntax Q12 of 15
Rest API - HTTP Status Codes

Which of the following is the correct way to respond with a 400 Bad Request status in a REST API using HTTP headers?

AHTTP/1.1 200 OK
BHTTP/1.1 500 Internal Server Error
CHTTP/1.1 400 Bad Request
DHTTP/1.1 404 Not Found
Step-by-Step Solution
Solution:
  1. Step 1: Recall HTTP status line format

    The status line starts with HTTP version, then status code and reason phrase.
  2. Step 2: Match status code to 400 Bad Request

    The correct status line for 400 Bad Request is "HTTP/1.1 400 Bad Request".
  3. Final Answer:

    HTTP/1.1 400 Bad Request -> Option C
  4. Quick Check:

    Status line for 400 = HTTP/1.1 400 Bad Request [OK]
Quick Trick: 400 status line always includes '400 Bad Request' phrase [OK]
Common Mistakes:
  • Using 200 OK for error responses
  • Confusing 400 with 500 server error
  • Using 404 Not Found for bad requests

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Rest API Quizzes