Rest API/Rest API Web Service and MPS
24 ビュー (過去 30 日間)
A client will provide a REST API and I need to connect to it through a locally installed Matlab (not Matlab Production Server), download and crunch some data and then send the results back.
I don't have experience with this yet so please excuse if I am mixing terms
Right now I am trying to understand which is the relevant documentation for me and there are two options I am looking at;
1) The methods listed here - https://nl.mathworks.com/help/matlab/internet-file-access.html?s_tid=CRUX_lftnav , all relate to a RESTful Web Service. I don't know yet if the client has a REST API that can be categorized as a web service (it will provide some internal client data) - would anybody know what the 'standard' use case for a REST API is and if it will likely be considered as a 'web service'? I guess the 'web' service part refers to the HTTP protocol and it does need to be a website?
2) Then there is a bunch of documentation related specifically for the Matlab Production Server, which seems to me to be a more general version of dealing with REST APIs - https://nl.mathworks.com/help/mps/restful-api-and-json.html
However, if I understand it well, the second option is exclusive to MPS (and this is not what we will be using to access the API - we will be using standard Matlab Standalone desktop version)
Appreciate any help and clarifications!
Kojiro Saito 2021 年 9 月 7 日
In REST API, there are two parts, client and server.
For REST API client, 1) will be helpful. Especially, webread for HTTP GET request and webwrite for HTTP POST request.
Also, there is matlab.net.http command which will be used for accessing compilcated REST API endpoint.
I suppose your client will provide REST API server, so you might need to call it from MATLAB. So, 1) would be your choice.