Download files from https server using username and password
23 次查看(过去 30 天)
显示 更早的评论
url = 'https://cddis.nasa.gov/archive/gnss/products/0971/';
In this https server, I need to download "cod09710.eph.Z" file for a specific location in my computer. How I can download this file using username and password related to this https server?
0 个评论
采纳的回答
Rik
2021-8-12
You should be able to use websave. You can provide a username and password in weboptions:
weboptions
8 个评论
Patrik Brigant
2022-4-1
@Andre Ferreira Hi, are you using GAMP II aswell or did you solved the issue using Matlab? Thank you :)
更多回答(1 个)
Yongjian Feng
2021-8-12
Try this:
username = 'Your username here';
password = 'Your password here';
authStr = [username ':' password];
base64Str = ['Basic ' matlab.net.base64encode(authStr)];
headers = {'Authorization': base64Str};
options = weboptions('HeaderFields',headers);
webread('http://ip.jsontest.com', options)
7 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Web Services 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!