我正在使用 angularjs - 1.6。
我需要明确地向服务器发送一个 http GET 请求以及一个 cookie。
我的意思是,我知道一旦我们成功完成授权,每个 http 请求都会自动发送 cookie。
但就我而言,我需要明确发送。我怎样才能做到这一点。下面是https代码:
$cookies.put('JSESSIONID', 'lu5xxkdqgjk5qpv07ufhvln3');
$http({
url:"http://10.11.0.11:4440/api/21/projects",
method:"GET",
headers: { 'Accept': 'application/json',
'X-Rundeck-Auth-Token':'lu5xxkdqgjk5qpv07ufhvln3'},
"Access-Control-Allow-Credentials" : true
}).then(function(response) {
$scope.response = response.data;
alert("Report fot succeed"+response.data);
}, function(response) {
alert("error response:"+response.data);
});