$http。Post of angular vs . $。jquery. Post .
$http.post() vs $.post()
$http.post()是否在内部使用$。ajax的jquery或使自己的XMLHttpRequest?
我面临的问题Angular $http。Post方法不能用于asp.net web api
他们在做同样的任务,只是语法上有些不同。它们将调用底层的XMLHttpRequest
来执行对服务器的请求。
$http.post
不调用$.post
, Angular不依赖于jQuery
$http.post()
使自己的XMLHttpRequest就像jQuery.post()
。这两者之间的唯一区别是,它们在发出请求时默认请求content-type
,
jQuery.post()
使用application/x-www-form-urlencoded
Angular $http.post()
使用application/json