This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

matlab.net.http.field.GenericField class

Package: matlab.net.http.field
Superclasses: matlab.net.http.HeaderField

HTTP header field with any name and value

Description

Use a GenericField header field for testing or to work around a built-in restriction that might not be appropriate for your application. The HeaderField class and its subclasses validate the Value property for the given Name property. To override a Value that might otherwise be rejected, create a GenericField header field.

If a header field in a response message contains a value that is not valid for the field name, MATLAB® creates a GenericField object.

Class Attributes

Sealed

true

For information on class attributes, see Class Attributes.

Creation

obj = matlab.net.http.field.GenericField(name,value) creates an HTTP header field with the Name property set to name and the Value property set to value.

Properties

expand all

Header field name, specified as a string or character vector.

Attributes:

GetAccess

public

SetAccess

public

Header value, specified as a string or character vector.

Attributes:

GetAccess

public

SetAccess

public

Methods

expand all

Examples

collapse all

A Content-Length header field must contain a number.

The following statement generates an error.

field = matlab.net.http.field.ContentLengthField('abc');

If instead you need a character value, create a GenericField object.

field = matlab.net.http.field.GenericField('Content-Length','abc');

Introduced in R2016b