Main Content



Return value of parameter in field


[value,actname] = getParameter(field,name) returns the value of parameter name. If the parameter does not exist, then getParameter returns empty ([]).

Input Arguments

expand all

Header field, specified as a object.

Parameter name, specified as a string or a character vector.

The name must be a valid token, containing only characters defined in RFC 7230 Field Value Components, section 3.2.6. To set an unnamed parameter, use "" or ''.

Name matching is not case-sensitive, but value is case-sensitive. If name matches an existing parameter, but with a different case, then the parameter name is changed to the case of the specified name.

If there are multiple matching parameters, then all are changed to value.

Output Arguments

expand all

Parameter value returned as a string. If there are multiple matches, then value and actname are string vectors. If there are no matches, then value and actname are empty string arrays. The method removes quotes surrounding the parameter value from value.

Actual parameter name returned as a string, string vector, or empty string.

Introduced in R2018a