add "charset=utf-8" to content-type "application/json"
See original GitHub issueThe Request.prototype.json function sets Content-Type headers to application/json. utf-8 really should be the default imo, and this lead me to several hours of debugging hell to realize that the API I was working with rejects all but UTF-8 json.
I made these changes:
main.js, Line #803:
this.setHeader('content-type', 'application/json; charset=utf-8')
main.js, Line #807:
this.setHeader('content-type', 'application/json; charset=utf-8')
Is there anything wrong with this? Any thoughts?
Issue Analytics
- State:
- Created 11 years ago
- Reactions:11
- Comments:15 (6 by maintainers)
Top Results From Across the Web
application/json; charset=utf-8" really mean? - Stack Overflow
Content -type: application/json; charset=utf-8 designates the content to be in JSON format, encoded in the UTF-8 character encoding. Designating the encoding is ...
Read more >Akka Http how to add charset utf-8 to the content-type header
I dont find how to set the content type to "application/json; charset=UTF-8" with the completeOKWithFuture and Jackson marshaller.
Read more >How to make sure "content-type: application/json; charset=utf ...
When I run a HTTP Call, I get a JSON response, but the first line is always "content-type: application/json; charset=utf-8" (as shown below) ......
Read more >Why did I get "Error 400: CTGLA2001E : Invalid request ... - IBM
To fix the problem, all you need to do is to add "Content-Type: application/json; charset=UTF-8" at the header of the HTTP POST request....
Read more >"application/json; charset=utf-8" not supported - aerogear-dev
... is based on AFNetworking 121 When doing my login request in iOS I bumped into the issue of having content type set...
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
Section 3 of RFC 4627 defines how the charset is detected using the first 4 bytes of the file, which is why it does not define a charset parameter. Adding a charset parameter is contrary to the standard because the standard defines the set of parameters for the media type and their interpretation and it does not include a charset parameter (Section 6).
It’s ok, Tim Berners-Lee couldn’t affect this thread.
Vote however you want.
Smart
On May 25, 2013, at 6:52 PM, Kevin Locke notifications@github.com wrote: