Main Content

initialize

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

Prepare StringConsumer for new HTTP message

Syntax

OK = initialize(consumer)

Description

OK = initialize(consumer) prepares this StringConsumer for receipt of a message.

MATLAB® calls this method, which is an overridden method of initialize.

initialize returns true if one of the following occurs. Otherwise, it returns false.

  • Response.Status is OK and the Charset property is not empty.

  • ContentType is set to a MediaType with a known or default charset.

You can process a message with an empty Charset property or with an unknown matlab.net.http.MediaType. To do this, set Charset after creating the consumer or write a subclass that overrides this method to set Charset before invoking initialize.

See the StringConsumer constructor for a list of known default charsets.

Input Arguments

expand all

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

Attributes

Accessprotected
Introduced in R2018a