首頁  >  文章  >  微信小程式  >  微信小程式 網路請求(post請求,get請求)

微信小程式 網路請求(post請求,get請求)

高洛峰
高洛峰原創
2017-02-17 10:11:502062瀏覽

這篇文章主要介紹了微信小程式網路請求(post請求,get請求)的相關資料,需要的朋友可以參考下

微信小程式網路請求

1.post請求:

reee

2.GET請求

onLoad: function() { 
  that = this; 
  wx.request( { 
   url: "url", 
   header: { 
    "Content-Type": "application/x-www-form-urlencoded" 
   }, 
   method: "POST", 
   data: {}, 
   complete: function( res ) { 
    console.log(res.data)
    }); 
    if( res == null || res.data == null ) { 
     console.error( '网络请求失败' ); 
     return; 
    } 
   } 
  }) 
 },

感謝閱讀,希望能幫助大家,謝謝大家對本站的支持!

更多微信小程式 網路請求(post請求,get請求)相關文章請關注PHP中文網!

陳述:
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn