matlab.net.http.HeaderField Class
Namespace: matlab.net.http
Header field of HTTP message
Description
Use the HeaderField class to implement a header field for an HTTP message.
The class provides conversions between strings in the header and MATLAB® objects, arrays, and structures. Although you can set the
HeaderField properties to arbitrary values, HTTP header fields have
constraints on the allowed characters.
The Name property defines the header field type. MATLAB provides subclasses for commonly used fields in the
matlab.net.http.field namespace. To see a list of supported subclasses,
call the HeaderField.displaySubclasses method.
Creation
Description
obj = matlab.net.http.HeaderField(name,value) creates a header
field with the Name property set to
name and the Value property set to
value. Either argument can be an empty double, [].
You can specify several argument pairs in any order as
name1,value1,...,nameN,valueN. If the last value
argument is missing, then HeaderField treats it as empty.
Properties
Methods
Examples
Tips
The
HeaderFieldconstructor creates fields of classHeaderField. To create a field of a class defined in thematlab.net.http.fieldnamespace, use the subclass constructor instead. For a list of subclasses, call theHeaderField.displaySubclassesmethod.For example, the
matlab.net.http.field.DateFieldsubclass creates a Date header field. If you use theHeaderFieldclass to create a Date field, theDateFieldclass interprets and enforces the value, even thoughHeaderFieldis not an instance ofDateField. Likewise, if you convert the field value to a MATLABdatetimevalue, theDateField.convertmethod is used.If the
HeaderFieldconstructor rejects theNameandValuearguments, use theGenericFieldclass constructor instead.
Version History
Introduced in R2016b