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. class


HTTP Accept header field


The AcceptField 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.


obj = 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.


expand all

Header field name, specified as 'Accept'.

Media type, specified as a vector of 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.

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



Return Value of AcceptField as vector of MediaType objects



Introduced in R2016b

Was this topic helpful?