How to make a RESTful request through a Kerberos proxy?
4 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
MathWorks Support Team
le 7 Avr 2020
Réponse apportée : MathWorks Support Team
le 7 Avr 2020
I am trying to make a RESTful request using the code below:
data = webread('https://www.mySite.com/api/FILE.csv')
However, MATLAB is failing and returns:
Error using webread (line 122)
Could not access server. Host not found: http://proxy:Port
My system has a proxy server implemented and all the connections go through it. I do not have a username or password, I only have a .PEM file with the certificates. How can I solve it?
Réponse acceptée
MathWorks Support Team
le 7 Avr 2020
Direct Kerberos support was introduced in MATLAB R2019b. Hence, if you have access MATALB R2019b or newer, you can pass your certificates file as show below:
site = 'https://www.mySite.com/api/FILE.csv';
options = weboptions('CertificateFilename','C:\PATH\TO\YOUR\FILE.pem');
out = webread(site, options)
Refer to the Server Authentication documentation page below for more information:
However, this will mostly likely not work in older versions of MATLAB. In those cases, the best alternative is to use system command 'curl' as follows (ask your system administrator for the exact details on how to set up the call to "curl"):
[status, result] = system('curl https://www.mySite.com/api/FILE.csv --proxy https://your-proxy-web --proxy-user ":" --proxy-negotiate --proxy-cacert PATH/TO/YOUR/FILE.PEM ')
0 commentaires
Plus de réponses (0)
Voir également
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!