application/json
The standard MIME type for JavaScript Object Notation (JSON) data interchange.
What Is This?
The application/json MIME type indicates that the content being transmitted is JavaScript Object Notation (JSON) data. It is the most widely used content type for REST APIs, configuration files, and data interchange on the web. When a server sends application/json, the client knows to parse the response body as JSON rather than plain text or HTML.
Common Uses
REST and GraphQL API request and response bodies
Configuration files (package.json, tsconfig.json)
Browser localStorage and sessionStorage data serialization
WebSocket message payloads
Examples
Supported by all browsers. Modern browsers have native JSON.parse() and JSON.stringify() methods for handling application/json responses.
The .json file extension maps to application/json as its MIME type.
Related Entries
More from this reference:
application/pdf
The MIME type for PDF (Portable Document Format) documents.
application/zip
The MIME type for ZIP archive files used for compression and bundling.
application/xml
The MIME type for XML documents and data interchange.
application/octet-stream
The generic MIME type for arbitrary binary data, often used for unknown file types or forced downloads.
Frequently Asked Questions
Do I need to set application/json for every API response?
Yes. Always set Content-Type: application/json on JSON API responses. Without it, clients may not parse the response correctly and some browsers show a download prompt instead of processing the data.
What happens if I send application/json with invalid JSON?
The client will fail to parse the response and throw a JSON parse error. Always validate JSON before sending it with application/json content type.