Package: matlab.net.http.io
Superclasses: matlab.net.http.io.ContentProvider
ContentProvider to send MATLAB strings
Use a StringProvider
object to send a MATLAB® string or character vector in a RequestMessage
. By default, if a
RequestMessage.Body.Data
property contains a string or character
vector, then it is converted to binary according to the encoding (charset) specified or
implied by the Content-Type field in the message, so you would not normally need to use this
object to send plain text in cases where MATLAB can determine what encoding to use.
Use this object in a Request.Body
property to send a string encoded
using a charset that might be different from the one that MATLAB would use for the Content-Type in the header. You specify that charset in the
ContentProvider
constructor or by setting the Charset
property. If the message contains no Content-Type, this provider adds one specifying
"text/plain"
and the specified charset.
The matlab.net.http.io.StringProvider
class is a handle
class.
provider = StringProvider
constructs a
StringProvider
to send the data in the Data
property
encoded with the value specified in the Charset
property. Set these
properties before sending a message that contains this provider.
provider = StringProvider(
constructs a data
,charset
)StringProvider
to send the specified data
encoded with the specified charset
. The constructor sets the
Data
property to the value of data
and the
Charset
property to the value of charset
. The
charset
argument is optional.