1

I was expecting that "application/json" and "application/json;charset=UTF-8" will behave same way considering that default encoding for jackson is UTF-8 but to my surprise it does not.

{"name":"test-生"}

Posting above data to simple spring-boot app with content-type="application/json" results in garbled data. What did I misunderstood?

I also came across several SO questions around this which seems to suggest my expectation was correct but doesn't seem to work.

I am on Spring-Boot = 1.3.5.Release

What does "Content-type: application/json; charset=utf-8" really mean?

Why content type header to use for json? "application/json; charset=utf-8 " or "application/json"?

Community
  • 1
  • 1
itwarilal
  • 1,314
  • 1
  • 10
  • 17
  • Also, spring has default encoding of utf-8 as per doc. So what am I missing? spring.http.encoding.charset=UTF-8 # Charset of HTTP requests and responses. Added to the "Content-Type" header if not set explicitly. spring.http.encoding.enabled=true # Enable http encoding support. – itwarilal Dec 01 '16 at 01:16

0 Answers0