What is the correct JSON content type?
Learn about MIME types and how the browser and your JSON code interacts.
While the content type is sometimes ignored by an application, it is wise to set it anyways, in case of unforeseen future uses of your code. In this video Craig Buckler distinguishes between the content types required for JSON and JSON-P applications: “application/json” and “application/javascript.” Novice JavaScript developers will better understand MIME types and how the browser and their code interact.
Discover in-depth JavaScript training with our Safari Learning Paths.
Craig Buckler is an experienced Web Developer working in the UK who started his career creating desktop software. Craig has worked for a number of well-known companies, including Microsoft, MSN, and Thomson Reuters, as well as the UK & EU governments. Craig is the prolific author of countless articles and tutorials on HTML5, CSS3, JavaScript, JQuery, PHP, and Node.js.