Bird
0
0

Which of the following is the correct way to indicate JSON data in the request body header?

easy📝 Syntax Q12 of 15
Rest API - Request and Response Format
Which of the following is the correct way to indicate JSON data in the request body header?
AContent-Type: text/plain
BContent-Type: application/xml
CContent-Type: application/json
DContent-Type: multipart/form-data
Step-by-Step Solution
Solution:
  1. Step 1: Identify the header for JSON data

    The header Content-Type: application/json tells the server the body contains JSON formatted data.
  2. Step 2: Compare with other content types

    text/plain is plain text, multipart/form-data is for file uploads, and application/xml is for XML data.
  3. Final Answer:

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

    JSON header = application/json [OK]
Quick Trick: Use application/json for JSON request bodies [OK]
Common Mistakes:
  • Using text/plain for JSON data
  • Forgetting to set Content-Type header
  • Using multipart/form-data without files

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Rest API Quizzes