0
NativeScript Http模塊具有從遠程服務器下載文件並將其保存在設備上的簡單而好的方法。如何將授權標頭設置爲NativeScript http.getFile?
var filePath = fs.path.join(fs.knownFolders.documents().path, 'test.png');
http.getFile('https://httpbin.org/image/png', filePath).then(function (r) {
// Argument (r) is File!
}, function (e) {
// Argument (e) is Error!
});
但今天我需要設置授權頭,我不知道該怎麼做...
NativeScript Http module documentation