-
慕哥9229398
我相信这是一个简单的添加:contentType: "application/json"作为对象属性。请参阅文档中的contentType属性。完整示例:...$.ajax({ url: '', contentType: 'application/json', headers: { "listkey":{"key1":"val1", "key2": "val2", "key3":"val3"} }, dataType: 'json', cache: false, success: function(data) {...
-
HUWWW
您可以使用该contentType属性来设置content-type标题,即您要发送到服务器的内容。您可以使用该accept属性告诉服务器您想要返回什么。$.ajax({ contentType: 'application/json', accept: 'application/json', url: '', headers: { "listkey":{"key1":"val1", "key2": "val2", "key3":"val3"} }, dataType: 'json', cache: false, success: function(data) {...
-
繁花如伊
这有效:$.ajax({ contentType: 'application/json', accept: 'application/json', url: '', headers: { "listkey": '{"key1":"val1", "key2": "val2", "key3":"val3"}' }, dataType: 'json', cache: false, success: function(data) {...