JSON text/plain
See original GitHub issueSeems that “Post JSON” don’t work. Because if body is string (and JSON is actually a string) polyfill sets header ‘content-type’ to ‘text/plain;charset=UTF-8’
But in docs:
fetch('/users', {
method: 'POST',
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json'
},
body: JSON.stringify({
name: 'Hubot',
login: 'hubot',
})
})
Issue Analytics
- State:
- Created 7 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Advantages of using application/json over text/plain? [closed]
JSon is basically a format of plain text. As such it can't be faster than the best plain text ...
Read more >What is JSON text ? - GeeksforGeeks
JSON is just the plain text written as a javascript object. There exist several key-value pairs which represent some useful information. The ...
Read more >Convert JSON to Plain Text - Online JSON Tools
Simple, free and easy to use online tool that converts JSON to plain text. No ads, popups or nonsense, just a JSON to...
Read more >What is the Correct Content-Type for JSON? Request Header ...
JSON has to be correctly interpreted by the browser to be used appropriately. text/plain was typically used for JSON, but according to IANA, ......
Read more >Content-Type is text/plain instead of application/json #4768
Describe the bug. The route api/v1/query_range returns a json body but the content-type header is set to test/plain. To Reproduce
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
You seem to be sending a POST to another domain. Please familiarize yourself with CORS to learn what’s blocking you from changing the Content-Type of the request.
@mislav sorry, that was about server configuration. Fetch is a great way to write XHR 😃