5
AngularJS를 사용하여 jQuery와 비슷한 글로벌 헤더를 만들려면 어떻게해야합니까? 이 같은AngularJS 게시물의 글로벌 헤더
뭔가 :
$.ajaxSetup({
beforeSend: function (xhr) {
xhr.setRequestHeader('Requested-With', 'XMLHttpRequest');
xhr.setRequestHeader('__RequestVerificationToken', 'abc123');
}
});
가 지금 내가이 일을 :
$http({
url: 'mysite.com/',
method: 'POST',
data: 'data',
headers: {'Content-Type': 'application/x-www-form-urlencoded'}
})
읽기 섹션 문서에서 헤더 설정 – charlietfl