我自己測(cè)試微信小程序的wx.request功能。header設(shè)置 'Content-Type': 'json' 能獲取到結(jié)果wx.request({ url: 'https://api.douban.com/v2/movie/in_theaters', method: 'GET', header: { 'Content-Type': 'json' // 使用這個(gè)能正常獲取數(shù)據(jù) }, success: function(res) { console.log(res); }})header設(shè)置 'Content-Type': 'application/json' 不能獲取結(jié)果wx.request({ url: 'https://api.douban.com/v2/movie/in_theaters', method: 'GET', header: { 'Content-Type': 'application/json'// 使用這個(gè)不能獲取數(shù)據(jù) }, success: function(res) { console.log(res); }})這兩種寫法到底有什么不同?為什么會(huì)導(dǎo)致這種問題產(chǎn)生?'Content-Type': 'json''Content-Type': 'application/json'
微信小程序wx.request的header疑問
ibeautiful
2019-02-15 10:15:57