Documentation

This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

RESTful API and JSON

Create client programs using the RESTful API and JSON

The MATLAB® Production Server™ RESTful API enables you to evaluate MATLAB functions on remote servers using JSON representation of MATLAB data types. You can create client programs in any programming language with an HTTP library. To communicate with MATLAB Production Server, a client must use:

  • RESTful API for the request-response relationship with the server.

  • JSON to represent MATLAB data types.

Client code that uses the MATLAB Production Server RESTful API and JSON Representation of MATLAB Data Types can be written in web-based languages such as JavaScript® and embedded in HTML pages. These web pages can then be used to send and retrieve requests from a MATLAB Production Server instance.

While web-based applications may be more amenable to client code written in JavaScript, you can use any HTTP supported programming language such Java, Python, C++, .NET, and many others to develop client applications.

If client programs will make requests from different domains, programmers using JavaScript must verify whether Cross-Origin Resource Sharing (CORS) is enabled on the MATLAB Production Server. To enable CORS on the server, set the approporiate value for the option cors-allowed-origins in the server's main_config file.

The RESTful API supports both the synchronous and asynchronous execution of requests on the server.

Note

In order to use RESTful API and JSON functionality, you must be running MATLAB Production Server and MATLAB Runtime for R2016a or later.

RESTful API Calls for Synchronous Mode

Topics

RESTful API

Learn how the request-response model of the RESTful API operates in synchronous and asynchronous modes

JSON Representation of MATLAB Data Types

Description of how to represent MATLAB data types in JSON

Troubleshooting RESTful API Errors

List of HTTP status codes and possible errors

Example: Web-Based Bond Pricing Tool Using JavaScript

Example of a web-based bond pricing tool using embedded JavaScript

Was this topic helpful?