1

Is there a way to send PUT and DELETE requests with webread() / webwrite()?

Trying to do opt = weboptions('RequestMethod','delete') gets me the following error message:

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.
ImAlsoGreg
  • 655
  • 6
  • 17

2 Answers2

3

MATLAB doesn't have full REST capability easily. You can expand it by using urlread2 http://www.mathworks.com/matlabcentral/fileexchange/35693-urlread2 or writing your own Java code.

Eugene K
  • 3,381
  • 2
  • 23
  • 36
2

As of 2016b this can be done with 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')