Can charset parameter be used with application/json content type in http/1.1?

后端 未结 3 1604
耶瑟儿~
耶瑟儿~ 2020-12-03 05:58

For example, is it valid ajax request:

$.ajax({
    type: \"POST\",
    url: \"SomePage.aspx/GetSomeObjects\",         


        
3条回答
  •  难免孤独
    2020-12-03 06:25

    application/json doesn't define a charset parameter, so it is incorrect to include one. What RFC 2046 says is that application types in general could have a charset parameter, such as application/xml. But JSON does not.

提交回复
热议问题