angularJS 發送get、post請求


$http.get(url)
.success(function(data){   console.log(data); }).error(function(err){
  console.log(err);
})

 post請求

$http({
  method:'POST',
  url:'http://192.168.1.107:8080/healthy/findAllColumn.do',
  data:{relation:17},
  headers:{'Content-Type': 'application/x-www-form-urlencoded'}  //重點,不要忘記漏寫
}).then(function(data){
  console.log(data);
},function (err){
  console.log(err);
})

  


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM