Main Content

putData

Class: matlab.net.http.io.JSONConsumer
Package: matlab.net.http.io

Save next buffer of JSON data for JSONConsumer

Syntax

[len,stop] = putData(consumer,data)

Description

[len,stop] = putData(consumer,data) passes data to the superclass to convert the uint8 buffer to a string, and then uses jsondecode to decode it and insert it into Response.Body.Data.

This method might not store the decoded JSON data until the entire message has been read.

This method is an overridden method of putData. You can override this method to examine or alter the uint8 data before conversion, or the JSON data after decoding.

Input Arguments

expand all

Content consumer, specified as a matlab.net.http.io.JSONConsumer object.

Buffer of raw data in a matlab.net.http.ResponseMessage object, specified as a nonempty uint8 vector, uint8.empty, or []. For more information about these values, see the data input argument for the ContentConsumer.putData method.

Output Arguments

expand all

Length of data processed, returned as double or empty double. For more information, see the size argument in ContentConsumer.putData.

Indicate whether to receive further data from this message, returned as true or false. For more information, see the stop argument in ContentConsumer.putData.

Attributes

Accesspublic

To learn about attributes of methods, see Method Attributes.

Introduced in R2018a