您的位置:首页 > 编程语言 > Java开发

spring 415

2015-10-12 15:09 519 查看
不支持的媒体类型
spring mvc 使用@requestBody注解json请求时,jQuery有限制,否则会出现 415 错误
1、使用ajax $.ajax({ data: JSON.stringify(Abstract.searchCondition), url: url, async: true, type: 'post', contentType: 'application/json', success: function (response) { }, complete:function(){ }, error: function (XMLHttpRequest, timeout, errorThrown) { } });
2、使用post
$.ajaxSetup({
headers: {'Content-type': 'application/json;charset=UTF-8'}
});
$.post('/applications/overview/getTransactionsChartData',
JSON.stringify(data), function (response) {
}
}, 'JSON');
};


来自为知笔记(Wiz)
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: