Package: matlab.net.http.io
Superclasses: matlab.net.http.io.StringProvider
ContentProvider to send MATLAB data as JSON string
Use a JSONProvider
object to convert MATLAB® data to a JSON string and send it in a RequestMessage
. Conversion
is done using jsonencode
.
If the RequestMessage
contains no Content-Type header field, then this
provider adds one specifying "application/json"
. Otherwise, the header
field is not modified and conversion is done even if its value is inconsistent with JSON
data.
For nonmultipart messages, you do not usually specify this provider explicitly, as the
contents of MessageBody.Data
is automatically converted to JSON if the
Content-Type of the message is "application/json"
. For more information,
see MessageBody.Data
. Specify this provider explicitly to send JSON data
for other Content-Types, or to send JSON data as a part in a multipart message.
The matlab.net.http.io.JSONProvider
class is a handle
class.
provider = JSONProvider(
constructs a
data
)ContentProvider
with the JSONData
property set to
data
.
ContentProvider
| JSONConsumer
| MessageBody
| RequestMessage
| StringProvider
| jsonencode