Can Matlab capture a Server responses sent to HTML5 client?

3 次查看(过去 30 天)
Is it possible to use Matlab to intercept a server responses sent to HTML5?
In python, it's done via:
import urllib.request
requestbody = ('{"Instrument":0}')
req = urllib.request.Request(
url='https:blahblahblah',
data=requestbody.encode('utf-8'),
headers={
'content-type': 'application/json',
'user-agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_5) AppleWebKit/537.35 (KHTML, like Gecko) Chrome/68.0.3440.105 Safari/537.35',
'cookie': cookie
} )
response = urllib.request.urlopen(req).read().decode('utf-8')
I'd rather not have to install Python and use Matlab (java). Is Matlab capable of retrieving the server responses? If so, can you please tell me how or point me in the right direction?
Thank you in advance for reading and any possible help!

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Call Python from MATLAB 的更多信息

产品


版本

R2016b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by