簡體   English   中英

$http 獲取 angularjs 無法傳遞參數?

[英]$http get angularjs unable to pass param?

var myFunc = function(url){

        console.log(url);

          $http({
              url: "http://example.me/",
              method: "GET",
              data:{url:url},
          }).finally(function () {
})

不知道為什么當我在我的 PHP $_GET['url'] 中回顯時我什么也沒得到,上面的 snytax 有什么問題嗎? 順便說一句,我沒有收到任何錯誤。

使用“ params ”,而不是“data”,數據用於POST或PUT方法

$http({
   url: "http://example.me/",
   method: "GET",
   params:{url:url},
}).finally(function () {

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM