putData
Class: matlab.net.http.io.MultipartConsumer
Namespace: matlab.net.http.io
Process next buffer of data for MultipartConsumer
Syntax
[length,stop] = putData(consumer,data)
Description
[
accumulates buffers of length,stop] = putData(consumer,data)data until an entire part of a multipart
message has been assembled. It then uses the Content-Type field in the part's header to
find an appropriate ContentConsumer delegate that can handle that type,
sets the delegate's Header property to the header of the part, and
then calls initialize and start in that delegate. It
follows that with one or more putData calls, passing in the part's
payload, and then calls putData(uint8.empty) to indicate the end of the
payload.
After the final call to the delegate's putData, this method creates a
ResponseMessage containing the header of the part and a
Body copied from Response.Body in the
delegate. (That Body might or might not contain data, depending on
what the delegate does.) It adds that new ResponseMessage to the array of
ResponseMessage objects in this consumer's
Response.Body.Data property, which, when the end of the message
has been reached, contains one ResponseMessage for every part.
This method is an overridden method of putData. If you override this method and return
stop=true before the end of the message (if
data is not empty) in order to terminate receipt of the message
before the normal end of message, you should avoid calling this superclass method on the
subsequent putData(uint8.empty) call that MATLAB® normally makes after you set stop. Failure to do so
results in an invalid message exception from MultipartConsumer due to a
premature end of message.
Input Arguments
Output Arguments
Attributes
Access | public |
Version History
Introduced in R2018a