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?
- What is the easiest way to convert an Excel spreadsheet with tabular data to JSON? [closed]
- 403 Forbidden vs 401 Unauthorized HTTP responses
- Use a JSON array with objects with javascript
- How to reformat JSON in Notepad++?
- Possible reason for NGINX 499 error codes
- YAML equivalent of array of objects in JSON
- Convert a python dict to a string and back
- TypeError: Object of type ‘bytes’ is not JSON serializable
- How to compare arrays in JavaScript?
- How to overcome “datetime.datetime not JSON serializable”?
- Access Control Request Headers, is added to header in AJAX request with jQuery
- React Js: Uncaught (in promise) SyntaxError: Unexpected token < in JSON at position 0
- Read and parse a Json File in C#
- What’s the point of the X-Requested-With header?
- What is the difference between json.load() and json.loads() functions
- How to read json file into java with simple JSON library
- JSON.NET Error Self referencing loop detected for type
- TypeError: expected str, bytes or os.PathLike object, not _io.TextIOWrapper
- How to parse Excel (XLS) file in Javascript/HTML5
- Jackson with JSON: Unrecognized field, not marked as ignorable
- How to easily convert a BufferedReader to a String?
- When looking at the differences between X-Auth-Token vs Authorization headers, which is preferred?
- How do I make a JSON object with multiple arrays?
- WP Rest API – How to get featured image
- WordPress function that makes HTML safe to be sent via AJAX request
- Unset data in custom post type WordPress API (wp-json)
- How to retrieve wp_ json_encode data from custom WordPress database table
- wordpress wp-json prefix issue
- How to Use JSON With AJAX?
- ping_status in JSON REST API
- parse json object and display live in wordpress php widget
- Increase the page size of the WordPress REST API
- creating shortcode to pull json array
- Upload a json file in php [closed]
- Hook Into the_content Filter For JSON API Only [closed]
- Placing assets for external use
- Output JSON object with woocommerce products
- Unable to parse JSON response from wp_send_json_success [closed]
- How to get those data using with ajax json?
- Pre insert data when adding new custom post fire a json error
- Fetch post block/field data as JSON with WordPress API
- Data storage for JS app using WP REST API
- If I use WordPress REST API V2 and someone makes an app using it. Will my site count the posts views from the APP? And if not, then how?
- json_decode does not work on WordPress
- How to add/edit advanced custom fields on custom post type’s WordPress REST API?
- How to get a custom entry field label with Gravity Forms?
- How to include a JSON file on my page?
- JSON – Create rest api endpoint for Advanced Custom Fields
- Custom WP API endpoint NULL body data
- Why WordPress not using JSON_UNESCAPED_UNICODE by default?
- Importing JSON feed giving Notice: Array to string conversion error
- Plugin Development: Storing and Manipulating Data That Fits JSON in Database
- how to use nimble-API and Display data?
- Display full WordPress post under search form using AJAX
- DELETE request using WP REST API
- WordPress Woocommerce REST API JSON Error
- How to add a PW Gift Card to a Woocommerce Order request API?
- Whats the best practise on how to store json data from a custom settings page?
- Can’t pass var from php wp_ajax into ajax script : result undefined or null
- Using wp_send_json_success instead of $result[‘message’], die, etc
- In a plugin, How to update a json file using ajax
- Publishing failed. The response is not a valid JSON response
- How do i POST to WordPress rest API from the same domain?
- Implementing URL JSON API Data into Website
- CRUD from WordPress to Business Central 365 through OData REST API
- Images names not inserting in WordPress Database from Dynamic Add / Remove fields
- JSON Schema Output Object rather than Array
- Zip a file and add as attachment
- AJAX POST Value not being returned – WordPress – AutoTrader API
- REST API get featured image source for custom post type
- Plugin json page
- how to correctly use json_encode with ajax
- WordPress API only returning HTML
- I want to use wordpress database in android app using json encode?
- how build custom json api controller for all registered users
- Implementing backbone.js to retrieve category posts using JSON API
- How does the JSON API work to parse incoming JSON and fetch a post based on an ID?
- Make Custom Fields Public in JSON – API
- Output pure JSON wordpress
- JSON Object Value Show Undefine
- get_body_params() is always empty in POST request
- Forminator + Hubspot Workflows
- How to get variable from other function inside class function using add_action for Ajax call