用 matlab 的 webread/webwrite 休息 DE​​LETE 动词

Rest DELETE verb with matlab's webread/webwrite

有没有办法用 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.

MATLAB 并不具备完整的 REST 功能。您可以使用 urlread2 http://www.mathworks.com/matlabcentral/fileexchange/35693-urlread2 或编写您自己的 Java 代码来扩展它。

截至 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://whosebug.com')