有没有办法用webread()
/ webwrite()
发送PUT和DELETE请求?
尝试执行opt = weboptions('RequestMethod','delete')
会收到以下错误消息:
Error using weboptions (line 223)
Expected RequestMethod to match one of these strings:
'auto', 'get', 'post'
The input, 'delete', did not match any of the valid strings.
答案 0 :(得分:3)
MATLAB没有轻松完整的REST功能。您可以使用urlread2 http://www.mathworks.com/matlabcentral/fileexchange/35693-urlread2或编写自己的Java代码来扩展它。
答案 1 :(得分:2)
截至2016b,可以使用matlab.net.http.RequestMessage完成 https://www.mathworks.com/help/matlab/matlab_external/send-http-message.html
request=matlab.net.http.RequestMessage('delete',[],matlab.net.http.MessageBody(''))
response=request.send( 'http://stackoverflow.com')