0
i create an spring/angularjs application but i have some problems with "post",when i tried to test the controller without angularjs i had this messageHTTP POST JSON(春/ angularjs)
[這是我的angularjs APP] [3]
$scope.ajouter_employe=function(){
$http({
method: 'POST',
url: "/employe1",
headers: {'Content-Type': 'application/json'},
data: {idEmploye: $scope.idEmploye}
}).then(function(response){
alert('yes');
});
}
它不起作用 { 「時間戳」:1495521855274, 「狀態」:415, 「錯誤」: 「不支持的媒體類型」, 「異常」:「org.springframework當我嘗試測試我控制器3210仍然有這個消息。 web.HttpMediaTypeNotSupportedException」, 「消息」: 「內容類型 '多部分/格式數據;邊界= ---- WebKitFormBoundaryShaAnQBDa47tg35j' 不支持」, 「路徑」: 「/ employe1」 }當我嘗試 「獲取」它工作正常! – hich