uni.downloadFile({
url: 'http://192.168.1.2/xx.mp4',
header: {
a: 'b'
}
})
如上代码,用两个不同的版本,发送的HTTP请求不一致,
3.3.13为
array(8) {
["icy-metadata"] => string(1) "1"
["host"] => string(12) "192.168.1.2"
["connection"] => string(5) "close"
["range"] => string(8) "bytes="
["accept"] => string(3) "*/*"
["user-agent"] => string(224) "Mozilla/5.0 (Linux; Android 11; Redmi K20 Pro Premium Edition Build/RKQ1.200826.002; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/98.0.4758.101 Mobile Safari/537.36 uni-app Html5Plus/1.0 (Immersed/34.909092)"
["content-length"] => string(0) ""
["content-type"] => string(0) ""
}
3.2.16为
array(7) {
["accept-encoding"] => string(4) "gzip"
["connection"] => string(10) "Keep-Alive"
["host"] => string(12) "192.168.1.2"
["user-agent"] => string(154) "Mozilla/5.0 (Linux; Android 7.1.2; SM-G977N Build/LMY48Z; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/92.0.4515.131 Mobile Safari/537.36"
["a"] => string(1) "b"
["content-length"] => string(0) ""
["content-type"] => string(0) ""
}
2 个回复
Architecture - 潜心钻研始于1999年,成长道路无止境。cgday@qq.com
你这个我怎么看着像浏览器的返回值啊?发送header,只要服务器那边能收到就可以了。按道理来说,无需返回值啊。
小枫同学 (作者)
api用错了,真尴尬
Architecture
好的,有问题随时沟通
2022-04-06 01:27
小枫同学 (作者)
回复 Architecture:好的, 谢谢大哥
2022-04-06 15:30