Bird
0
0

Consider this HTTP request:

medium📝 Debug Q6 of 15
Rest API - HTTP Methods
Consider this HTTP request:
GET /users/123 HTTP/1.1
Content-Type: application/json

{"name":"Alice"}
What is incorrect about this request?
AThe HTTP method should be POST
BContent-Type header is missing
CThe URL path is invalid
DGET requests should not have a message body
Step-by-Step Solution
Solution:
  1. Step 1: Understand GET semantics

    GET requests are not supposed to include a message body.
  2. Step 2: Analyze the request

    This request includes a JSON body, which is ignored or may cause issues.
  3. Final Answer:

    GET requests should not have a message body -> Option D
  4. Quick Check:

    GET with body is against HTTP spec [OK]
Quick Trick: GET requests must not contain a body [OK]
Common Mistakes:
  • Assuming Content-Type is required for GET
  • Thinking URL path is incorrect
  • Believing method should be POST for retrieval

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Rest API Quizzes