Name: revXMLRPC_AddParam

Type: command

Syntax: revXMLRPC_AddParam <XML-RPC document>, <type>, <value> 

Summary: Adds a single parameter to an XML-RPC document structure.

Introduced: 2.5

OS: mac,windows,linux

Platforms: desktop,server,web

Security: disk,process

Example:
revXMLRPC_AddParam theRequest, "int", 55

Example:
revXMLRPC_AddParam theRequest, "base64", base64Encode(theBinaryData)

Parameters:
type (bool): The type of data contained in the value parameter. The supported types are: 	* base64: the value is base64-encoded 	* boolean: the value is true or false 	* dateTime.iso8601: the value is an Internet date 	* double: the value is a floating-point number 	* int or i4: the value is an integer number 	* string: the value is a string of characters 	* array: the value is an array of data (see below) 	* xml: the value is data in xml-format (see below)
value: The content of the data you want to add as a new parameter.
documentID: The number returned by the revXMLRPC_CreateRequest when you created the XML-RPC request.

The result: If the <revXMLRPC_AddParam> <command> encounters an error, the <result> is set to an error message beginning with "xmlerr" or "xmlrpcerr".

Description:
Use the <revXMLRPC_AddParam> <command> to add a single parameter of a given type to an existing <XML-RPC document>.

To pass an array of data, you have to pass the type as well, in the following format:
	* array[:element type]

Example:
local theArray
repeat with i = 1 to 10
  put random(100) into theArray[i]
end repeat
revXMLRPC_AddParam theDocID, "array:int", theArray

If you do not specify an element type, the <revXMLRPC_AddParam> <command> assumes you're passing an array of strings.

If you need to add complex parameters (such as arrays of various types, or structs) you can specify a type of xml, and pass raw xml.

Example :
put "&lt;struct&gt;" & \
    "&lt;member&gt;&lt;name&gt;left&lt;/name&gt;" & \
    "&lt;value&gt;&lt;int&gt;10&lt;/int&gt;&lt;/value&gt;&lt;/member&gt;" & \
    "&lt;member&gt;&lt;name&gt;top&lt;/name&gt;" & \
    "&lt;value&gt;&lt;int&gt;50&lt;/int&gt;&lt;/value&gt;&lt;/member&gt;" & \
    "&lt;member&gt;&lt;name&gt;right&lt;/name&gt;" & \
    "&lt;value&gt;&lt;int&gt;390&lt;/int&gt;&lt;/value&gt;&lt;/member&gt;" & \
    "&lt;member&gt;&lt;name&gt;bottom&lt;/name&gt;" & \
    "&lt;value&gt;&lt;int&gt;240&lt;/int&gt;&lt;/value&gt;&lt;/member&gt;" & \
    "&lt;/struct&gt;" into theStruct
revXMLRPC_AddParam theDocID, "xml", theStruct

>*Important:*  The <revXMLRPC_AddParam> <command> is part of the <XML-RPC library>. To ensure that the <command> works in a <standalone application>, you must include this <Revolution custom library|custom library> when you create your <standalone application|standalone>. In the Inclusions section on the General screen of the <Standalone Application Settings> window, make sure "XML-RPC Library" is selected in the list of script libraries.

References: Standalone Application Settings (glossary), standalone application (glossary), command (glossary), XML-RPC document (glossary), revXMLRPC_GetParamType (function), revXMLRPC_GetParam (function), result (function), revXMLRPC_GetParamCount (function), XML-RPC library (library), Revolution custom library (library)

Tags: networking
