matlab.net.http.field.AcceptField class

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

HTTP Accept header field

Description

An AcceptField object is an HTTP header field in a request message. The field contains one or more media type specifications indicating the type of content acceptable to the client.

Class Attributes

Sealed

true

For information on class attributes, see Class Attributes.

Creation

Description

obj = matlab.net.http.field.AcceptField(value) creates an Accept header field with the Value property set to value.

Use an Accept field if the server can return different MediaType objects and you want to receive only certain types. If you do not specify an Accept field, the server might assume that you are willing to receive any type.

Properties

expand all

Header field name, specified as 'Accept'.

Attributes:

GetAccess

public

SetAccess

public

Media type, specified as a vector of matlab.net.http.MediaType objects, a vector of strings, or a cell array of character vectors. All strings must be acceptable to the MediaType constructor. Each Value represents a media type containing an optional quality ('q') parameter. The Value property of the field is a comma-separated list of the MediaType objects converted to strings.

Example: MediaType('application/json','q','.5')

Attributes:

GetAccess

public

SetAccess

public

Dependent

true

Methods

expand all

Introduced in R2016b