9
jQuery.ajaxでcontent-typeを 'application / json'に設定できません
このコードがあるとき $.ajax({ type: 'POST', //contentType: "application/json", url: 'http://localhost:16329/Hello', data: { name: 'norm' }, dataType: 'json' }); フィドラーで私は次の生の要求を見ることができます POST http://localhost:16329/Hello HTTP/1.1 Host: localhost:16329 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:10.0.2) Gecko/20100101 Firefox/10.0.2 Accept: application/json, text/javascript, */*; q=0.01 Accept-Language: ru-ru,ru;q=0.8,en-us;q=0.5,en;q=0.3 Accept-Encoding: gzip, deflate Connection: keep-alive Content-Type: application/x-www-form-urlencoded; charset=UTF-8 Referer: http://localhost:14693/WebSite1/index.html Content-Length: 9 …