Complete the POST Request
Fill in the Blank Medium
Question
Fill in the blank to set the content type header for a JSON POST body.
Code
fetch("/api/users", {
method: "POST",
headers: { "___": "application/json" },
body: JSON.stringify({ name: "Ada" })
});
Hint
It is the same header used in HTTP responses.
Explanation
The 'Content-Type' header tells the server what format the request body is in. For JSON, use 'application/json'. Without it, the server may not know how to parse the body. This is one of the most common headers in API requests.
Related Resources
Related Lessons
Look up unfamiliar terms
A beginner-friendly glossary explains jargon in plain English — variables, functions, DOM, Promise, and more.
Decode error messages
Plain-English explanations of common errors — what they mean, why they happen, and how to fix them.
Build real projects
Apply what you learned by building guided projects with starter code and solutions.