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.

addFields

Class: matlab.net.http.HeaderField
Package: matlab.net.http

Add fields to HeaderField array

Syntax

fields = addFields(fields,newFields)
fields = addFields(msg,fName,fValue)
fields = addFields(fields,fName1,fValue1,...,fNameN,fValueN)
fields = addFields(fields,index,___)

Description

fields = addFields(fields,newFields) 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,fValue) adds field with name fName and value fValue.

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

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

Input Arguments

expand all

Header fields, specified as an array of matlab.net.http.HeaderField objects.

Fields to add, specified as a vector or comma-separated list of one or more matlab.net.http.HeaderField objects.

Header field name, specified as a string.

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

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

Introduced in R2018a