For JSON text:
application/json
The MIME media type for JSON text is
application/json
. The default encoding is UTF-8. (Source: RFC 4627)
For JSONP (runnable JavaScript) with callback:
application/javascript
Here are some blog posts that were mentioned in the relevant comments:
- Why you shouldn’t use
text/html
for JSON - Internet Explorer sometimes has issues with
application/json
- A rather complete list of Mimetypes and what to use them for
- The official mime type list at IANA from @gnrfan’s answer below
Related Posts:
- What is the correct JSON content type?
- What is the correct JSON content type?
- How do I POST JSON data with cURL?
- How do I POST JSON data with cURL?
- How do I POST JSON data with cURL?
- Use of PUT vs PATCH methods in REST API real life scenarios
- Getting “java.io.IOException: An existing connection was forcibly closed by the remote host”
- How to do a PUT request with cURL?
- What’s the difference between text/xml vs application/xml for webservice response
- What are all the possible values for HTTP “Content-Type” header?
- How to use cURL to send Cookies?
- Proper MIME media type for PDF files
- HTTP GET with request body
- Using Wikipedia API on custom wikis like Bulbapedia
- SON Post with Customized HTTPHeader Field
- RestClientException: Could not extract response. no suitable HttpMessageConverter found
- How to POST JSON Data With PHP cURL?
- Why am I seeing “TypeError: string indices must be integers”?
- How to prettyprint a JSON file?
- What is the difference between POST and PUT in HTTP?
- What is JSONP, and why was it created?
- What does enctype=’multipart/form-data’ mean?
- How to install JQ on Mac on the command line?
- What does enctype=’multipart/form-data’ mean?
- How to read an external local JSON file in JavaScript?
- “CAUTION: provisional headers are shown” in Chrome debugger
- pretty-print JSON using JavaScript
- What is the “right” JSON date format?
- What is the “right” JSON date format?
- How to POST JSON data with Python Requests?
- Displaying better error message than “No JSON object could be decoded”
- How to remove the quotes when reading a variable in jq in shell?
- What is “X-Content-Type-Options=nosniff”?
- What is correct content-type for excel files?
- How to convert selected HTML to Json?
- How do you represent a JSON array of strings?
- JSON.parse() not working
- Refused to execute script, strict MIME type checking is enabled?
- JaxbRepresentation gives error “doesnt contain ObjectFactory.class or jaxb.index”
- How to integrate WordPress with Angular 8 for website?
- Fatal error: Maximum execution time of 30 seconds exceeded
- “NS_ERROR_DOM_BAD_URI: Access to restricted URI denied”
- How to generate .json file with PHP?
- How to get POSTed JSON in Flask?
- What are the Oembed Links For?
- How to use wp_localize_script in custom page template?
- How to get the path to current theme, but from a JS file?
- WP Rest API v2 filter and display latest post with specific tag
- WP JSON list all permalinks
- Trying to get custom post meta through Jetpack JSON API [closed]
- WP Rest API v2 return posts with specific tag
- Importing JSON feed should the content be sanitized?
- how to get a more significant error response from ServerSideRender
- Full-Ajax Theme: parseJSON error while building a JSON object from a WordPress custom template
- How to list categories and subcategories in JSON format?
- API JSON Data in WordPress
- fetch_feed: retrieve entries in the appearing order, not chronologically
- Generate dynamic page through data from another page
- WordPress REST API – Modify JSON before importing
- Most performant way of fetching remote API data?
- Adding JSON Structured Data to WordPress
- Dynamically insert values in a WordPress SelectControl Options field
- Customize JSON output
- wp_remote_get adding backslashes
- Run function when WordPress new multisite is created or ACF field is updated
- How to syntax Json output for translation?
- AngularJS with route and JSON API
- Intergrating agile carousel to wordpress: how to write the ajax_callback function
- How to Get Featured Image from REST API?
- How to enqueue or include json file to a plugin
- Ajax store response json in variables
- Blog titles from WP blog on plain html site?
- data (html) migration to posts
- Using WP_Query to grab custom meta values, foreach to json object
- Why is json_decode failing?
- merge wp rest api query to get posts per category does not work
- URL rewrite with external JSON query
- JSON API and notification about registration
- Parse wordpress blog data using json api and ajax
- 403 error when publishing a post in wordpress. Error => Publishing failed. The response is not a valid JSON response
- Optimal WP Web App Backend for mobile app development
- Showing results from json-string in WordPress search results page
- WordPress Theme/Plugin Information API Response to Text and Button
- Automatically import content to wordpress from a json file
- GET request return value as error instead of success
- Hi everyone, I have Problem with using wp_die()
- ajax response strips multidimensional array and unable to decode
- How to save one API response to WooCommerce order meta data
- Autotrader API Integration
- How can cookie/session authentication be used in wp-json fetch request?
- Rest WP_Error always return null
- Memory Leak in Processing Large JSON file
- Can’t get_users info by using json_encode
- WP Rest API v2.0 user profile update issue
- Developing a plugin, ran it through P3 Profiler, shows up slow, but I don’t know why
- Undefined property: stdClass::$ AND Trying to get property ‘name’ of non-object Error in plugin
- How do i save this python code to text file.? [closed]
- Restrict MIME type files in upload field + contact form 7
- Forminator + Hubspot Workflows
- How to get variable from other function inside class function using add_action for Ajax call