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?
- JSON parsing error syntax error unexpected end of input
- SOAP vs REST (differences)
- JSONDecodeError: Expecting value: line 1 column 1 (char 0)
- How to convert JSON to XML or XML to JSON?
- json.dumps vs flask.jsonify
- What is deserialize and serialize in JSON?
- Are multi-line strings allowed in JSON?
- How to make a class JSON serializable
- Nested JSON objects – do I have to use arrays for everything?
- Python ValueError: No JSON object could be decoded
- How to send a Map in JSON
- Deserialize JSON with C#
- What’s the difference between using application/csv vs text/csv? [duplicate]
- .rar, .zip files MIME Type
- Displaying better error message than “No JSON object could be decoded”
- Fetching JSON returns error Uncaught (in promise) SyntaxError: Unexpected token < in JSON at position 0 and status code 304: Not Modified
- Basic example of using .ajax() with JSONP?
- Uncaught TypeError: data.push is not a function
- Flask example with POST
- Returning JSON from PHP to JavaScript?
- How to call a REST web service API from JavaScript?
- How to convert the following json string to java object?
- PHP cURL HTTP PUT
- How to display raw JSON data on a HTML page
- How to add a button dynamically using jquery
- Complex JSON nesting of objects and arrays
- What is the relationship between WCF, Rest and SOAP?
- Postman Resolving “Invalid CORS request” for a POST Request
- Get JSON object from URL
- [npm notice created a lockfile as package-lock.json. You should commit this file
- Binance Long Short Ratio Chart In WordPress
- WP Rest API: details of latest post including featured media url in one request?
- using wp_remote_get instead of file_get_contents [duplicate]
- Show popular post in another php website via WP REST JSON API
- WordPress JSON output
- Setting default font family with theme.json
- WordPress REST endpoint with JSON for Mobile App integration
- JSON: schedule creation of json file
- WordPress Customizer Typography: How to load just the unique Google Fonts?
- Create a new user using WP REST API and declare meta object
- get all products of one category
- How to encode post content as JSON?
- Create filtered list of posts using JSON data
- Formating content rendered from wordpress REST API as JSON and not HTML
- Inserting Schema Markup (JSON-LD) Manually with Custom Fields or any Better Ways?
- How can I cache WordPress Rest API Response
- REST : how do you handle the rest_no_route error?
- featured image not found in json from wp rest api
- JSON API plugin, Get posts by category return no post
- Pass data from wordpress to javascript in JSON
- How to create a post using REST API with sending data as a JSON body?
- How to use wp_query to post count by search term > group post count by date > convert to json. (ex. result 12-21-2020 – 343)
- Why does wp_remote_post returns an empty body response on certain endpoints?
- Gutenberg Block with Select from JSON-File
- WordPress Unexpected token < in JSON at position 0
- Update the values of a json file in wordpress [closed]
- Loop Performance > JSON files vs. WP_Query vs. REST API
- attachment media-template data model (data.size.url)
- How to use json_decode a post_meta value? [duplicate]
- How to connect android app with WordPress website?
- Getting a GET error in console – 404 not found for wp-json
- How can I wp_send_json data?
- Easiest way to map content (in json) to the view (template)?
- how to search all user meta data that have value like “vivek”
- Wrong encoding of dynamic block properties problem
- Remove escape characters from JSON string pulled from a database
- Third-Party API – PHP Fatal Errors Paired with http_request_failed / cURL error 28
- WordPress output data to another website and pull data
- How does one make a URL return dynamic JSON with custom Content Type?
- Trigger action when submitting form with WPForms [closed]
- wp_send_json erase last value
- Populate select option with JSON file
- Uncaught TypeError: Cannot read property ‘ajax’ of undefined
- AJAX Call in Plugin Returns More than JSON
- Adding a time stamp on post view
- Syntax for a function in order to get post’s title in JSON encoded response [closed]
- How to post data to a word press site in case of a mobile app
- Pass a PHP variable (loop-audio.php) to jQuery function (js/script.js)
- How to apply Local Business Google Schema dynamically on a Custom Post single template?
- Programmatically creating posts based on external JSON feed (asynchronously)
- Bad Request 400… jQuery ajax post of json data to wordpress admin-ajax.php
- Convert acf/gutenberg markup to html
- $attributes not defined in block.json PHP template for ACF blocks