/ Angular:
content-type - , WebMethod , aspx ( jQuery, Angular.. )
ASP.NET AJAX
, ASP.NET - ASP.NET AJAX, GET, POST, , HTTP- ASP.NET HTTP Content-Type application/json. , ASP.NET AJAX .
, , , Angular :
$http.post("default.aspx/get_boleto", {});
:
$http({
method: 'POST',
url: "./Default.aspx/get_boleto",
data: {},
async: false
}).success(.....
XHR:
Angular XHR without data, content-type not :
POST /default.aspx/helloWorld HTTP/1.1
Host: localhost:51120
Connection: keep-alive
Content-Length: 0
Cache-Control: max-age=0
Accept: application/json, text/plain, */*
Origin: http://localhost:51120
User-Agent: ....
Referer: ....
Accept-Encoding: gzip,deflate,sdch
Accept-Language: en-US,en;q=0.8
Angular XHR with data,content-type :
POST /default.aspx/helloWorld HTTP/1.1
Host: localhost:51120
Connection: keep-alive
Content-Length: 2
Cache-Control: max-age=0
Accept: application/json, text/plain, */*
Origin: http://localhost:51120
User-Agent:...
Content-Type: application/json;charset=UTF-8
Referer: ....
Accept-Encoding: gzip,deflate,sdch
Accept-Language: en-US,en;q=0.8
New to Angular, so if there are better / simpler ways, I will postpone ...
Hth ...