AngularJs $ http.post可以正常使用http(非SSL)发布请求
但是对于https请求(启用了SSL),它给出了202。
我尝试将常见的Accept
或Content-Type
headers
设置为许多吸食
var app = angular.module('myApp', [], function ($httpProvider) {
//$httpProvider.defaults.headers.common = { 'Accept': '*/*' };
$httpProvider.defaults.headers.post = { "Content-Type": "application/x-www-form-urlencoded" };
});
http帖子正在使用快捷方式
var l_url = "https://.../ABC.svc/Get";
var Data = {};
var res = $http.post(l_url, Data);
res.success(function (data, status, headers, config) {
});
res.error(function (data, status, headers, config) {
});
以下是请求标题
Key Value
Request POST /WCF/abc.svc/Get HTTP/1.1
Content-Type application/x-www-form-urlencoded
Accept application/json, text/plain, */*
Referer https://..../abc.aspx
Accept-Language en-US
Accept-Encoding gzip, deflate
User-Agent Mozilla/5.0 (Windows NT 6.1; WOW64; Trident/7.0; rv:11.0) like Gecko
Host webapps.adterminals.ae
Content-Length 2
Connection Keep-Alive
Cookie __utma=4766435.232713021.1427716113.1432028677.1437554384.8; __utmz=4766435.1427716113.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none); _ga=GA1.2.232713021.1427716113; ASP.NET_SessionId=mshdtgl1hy0dctzumrl1tt3q; __utmc=4766435; .ASPXAUTH=D3E9D4B2C3BA24CE4F787D90745E97D2FED3C3E601CB3AF2C4168885084D4A97396749D85C5CD59245A42FBF4F95B539F2D0AAD8F27BD0721D07BDA4FB7B4360B56077A334F3E4E409815E4189935B8A02E2D356F34B9C111EB463A0949E4B1915E6872BF7336131179E6D67C297ECED2EB13F3BC2BCB59F96FCA80C8FE794E6
以下是回复标题
Key Value
Response HTTP/1.1 202 Accepted
Server Microsoft-IIS/8.5
X-Powered-By ASP.NET
X-UA-Compatible IE=Edge
Access-Control-Allow-Origin *
Access-Control-Allow-Headers X-Requested-With,Content-Type,Accept
Access-Control-Request-Method POST,GET,PUT,DELETE,OPTIONS
Access-Control-Allow-Methods POST,GET,OPTIONS
Access-Control-Max-Age 1728000
Date Wed, 22 Jul 2015 10:02:21 GMT
Content-Length 0
任何帮助都将受到高度赞赏。