나는 각도 전문가가 올바른 방향으로 나를 가리킬 수 있기를 바랍니다. 아래의 형식으로 공장을 사용하는 경우, 어떻게 있도록 POST의 헤더를 수정 않습니다AngularJS, 공장에서 http 헤더를 올바르게 수정하는 방법
'Content-Type':'application/x-www-form-urlencoded; charset=UTF-8'?
코드를 :
var tableModule = angular.module('theApp', ['ui-rangeSlider','ngScrollbar']);
tableModule.factory('Services', ['$http',
function($http) {
return {
get : function($path, callback) {
return $http.get($path).success(callback);
},
post : function($path, $data, callback) {
return $http.post($path, $data).success(callback);
}
};
}]);
왜 콜백을 제거 않았다을 사용할 수 있습니까? – nodoze
@nodoze 그냥 습관. 나는 약속 객체들과 함께 작업하는 것을 선호한다. 내 대답의 요점은 헤더를 전달하는 방법을 보여준 것이었다. – Phil
나는 이것이 트릭을했다고 생각한다. Phil에게 감사한다. 그것은 큰 문제를 해결하지 못했지만 헤더가 전달 된 것으로 보입니다. 내 큰 질문은 여기에있다 : http://stackoverflow.com/questions/26226519/accessing-post-data-in-python-with-cgi-fieldstorage-using-angularjs – nodoze