我对AngularJS的$http服务有一个奇怪的问题,据我所见,其他人都没有.
每次我使用$http.post()发送跨域请求时,我都可以在开发人员工具(网络窗格)中看到正在发送两个不同的请求:一个,没有任何数据,然后立即发送另一个请求拥有所有数据并返回来自服务器的正确响应.
这是一个例子:
$http.post(url+'getSiteList.PHP',{session_id: $scope.session_id(),withCredentials: true}) .success(function(data,status,headers,config) { console.log(data); ....