matlab.net.http.HeaderField.addFields - Add fields to HeaderField array - MATLAB (original) (raw)

Class: matlab.net.http.HeaderField
Namespace: matlab.net.http

Add fields to HeaderField array

Syntax

Description

fields = addFields([fields](#d126e778508),[newFields](#d126e778530)) adds newFields to the end of the HeaderField array fields and returns the updated array.addFields does not check for duplicate fields.

fields = addFields(`msg`,[fName](#d126e778554),[fValue](#d126e778573)) adds field with name fName and valuefValue.

fields = addFields([fields](#d126e778508),fName1,fValue1,...,fNameN,fValueN) adds fields specified by fName, fValue pair arguments, in the order specified.

fields = addFields([fields](#d126e778508),[index](#d126e778605),___) inserts fields at index and can include any of the input arguments in previous syntaxes.

Input Arguments

expand all

Header field name, specified as a string.

Header field value, specified as a string or any type valid forfName. To use the default value for the field, setfValue to ''. If the last value is missing, then it is the same as specifying [].

Location in header field array, specified as an integer. Ifindex is greater than the length of the header orindex is 0, the method adds fields to the end. Ifindex is negative, the method counts from the end of the header.

Version History

Introduced in R2018a