【发布时间】:2017-05-23 20:20:20
【问题描述】:
“时间戳”:1495521855274, “状态”:415, "error": "不支持的媒体类型", “异常”:“org.springframework.web.HttpMediaTypeNotSupportedException”, "message": "不支持内容类型'multipart/form-data;boundary=----WebKitFormBoundaryShaAnQBDa47tg35j'", “路径”:“/employe1”
@Autowired
private EmployeMetier EmployeMetier;
@RequestMapping(value="/employe1",method=RequestMethod.POST)
public Employe saveEmploye(@RequestBody Employe e) {
return EmployeMetier.saveEmploye(e);
}
[这是我的 angularjs 应用][3]
$scope.ajouter_employe=function(){
$http({
method: 'POST',
url: "/employe1",
headers: {'Content-Type': 'application/json'},
data: {idEmploye: $scope.idEmploye}
}).then( function(response){
alert('yes');
});
【问题讨论】:
标签: angularjs json spring http spring-mvc