jQuery的$ http.post与$ .post的区别。
$http.post() vs $.post()
它是$ http.post()在内部使用jQuery的$ .ajax或使其自己的XMLHttpRequest?
我面临的问题Angular $http.post method not working for asp.net web api
jQuery的$ http.post与$ .post的区别。
$http.post() vs $.post()
它是$ http.post()在内部使用jQuery的$ .ajax或使其自己的XMLHttpRequest?
我面临的问题Angular $http.post method not working for asp.net web api
他们正在做同样的工作,在语法只是一些差异。他们会调用底层XMLHttpRequest
向服务器发送请求。
$http.post
不会调用$.post
,Angular不依赖于jQuery。
$http.post()
自己的XMLHttpRequest就像jQuery.post()
一样。 这两者之间的唯一不同的是,它们的默认请求content-type
同时使请求,
jQuery.post()
使用application/x-www-form-urlencoded
角$http.post()
使用application/json