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 thisStringConsumerfor receipt of a message.

MATLAB®调用这个方法is an overridden method ofinitialize.

initializereturnstrueif one of the following occurs. Otherwise, it returnsfalse.

  • Response.StatusisOKand theCharsetproperty is not empty.

  • ContentType is set to aMediaTypewith a known or default charset.

You can process a message with an emptyCharsetproperty or with an unknownmatlab.net.http.MediaType. To do this, setCharsetafter creating the consumer or write a subclass that overrides this method to setCharsetbefore invokinginitialize.

See theStringConsumerconstructor for a list of known default charsets.

Input Arguments

expand all

Content consumer, specified as amatlab.net.http.io.StringConsumerobject.

Attributes

Access protected

Version History

Introduced in R2018a