Bird
0
0

Which of the following is the correct syntax to set the Content-Type header to JSON in an HTTP request?

easy📝 Syntax Q3 of 15
Rest API - Request and Response Format
Which of the following is the correct syntax to set the Content-Type header to JSON in an HTTP request?
AContent-Type: json/application
BContent-Type: application/json
CContentType: application/json
DContent-Type = application/json
Step-by-Step Solution
Solution:
  1. Step 1: Recall correct HTTP header syntax

    Headers use colon ':' to separate name and value, no equals sign or misspelling.
  2. Step 2: Verify media type for JSON

    The correct media type is 'application/json', not 'json/application'.
  3. Final Answer:

    Content-Type: application/json -> Option B
  4. Quick Check:

    Correct header syntax = Content-Type: application/json [OK]
Quick Trick: Use colon ':' to separate header name and value [OK]
Common Mistakes:
  • Using '=' instead of ':'
  • Misspelling Content-Type
  • Incorrect media type order

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Rest API Quizzes