Method HttpRequestMessage() :addParameter() Foundation

Adds a HTTP parameter.

:addParameter( <cName>, <cValue>|<aValues>  ) --> self
A character string with the name of the parameter.
A character string with the value of the parameter.
An array of parameter values, specified as character strings.

:addParameter() returns the object executing the method.


The method :addParameter() adds a HTTP parameter to the parameter list along with its value. Existing values are preserved, which means that if a parameter named <cName> already exists, the value specified in <cValue> is appended to this parameter's value list.

For adding a parameter with multiple values to the parameter list, an array of values can be assigned to the <aValues> parameter. In this case, the values in the array elements are added to the value list of the HTTP parameter in one go, instead of having to calling :addParameter() repeatedly.

The methods :addParameter(), :delParameter(), :getParameter(), :getParameters() and their respective :set..() counterparts allow direct and easy manipulation of name-value pairs that are transferred in the Http request. The parameters are transferred according to the request method. For the request method "GET", the parameters are transferred as name-value pairs in the query string. If the request method is "POST" or "PUT", the parameters are converted according to the content type and transferred in the body of the Http request.


If you see anything in the documentation that is not correct, does not match your experience with the particular feature or requires further clarification, please use this form to report a documentation issue.