Name: revXMLRPC_CreateRequest

Type: function

Syntax: revXMLRPC_CreateRequest([<host>],[<port>],[<path>],[<protocol>])

Summary: Creates an <XML-RPC request> structure, optionally setting its host, port, path and protocol.

Introduced: 2.5

OS: mac,windows,linux

Platforms: desktop,server,web

Security: disk,process

Example:
get revXMLRPC_CreateRequest(field "Host",field "Port",field "Path",field "Protocol")

Example:
put revXMLRPC_CreateRequest("example.com",80,"RPC2","http") into theRequest

Parameters:
host: The IP address or domain name of the host you want to connect to.
port: The port number you want to connect to. If you don't specify a port, port 80 is used. (On most systems, port 80 is used for HTTP connections.)
path: Usually a file path, which allows the host to determine which resource handles your request.
protocol: The protocol determines the type of connection that is established with the host. By default, XML-RPC uses HTTP connections, but for added security you can use HTTPS connections, if the host supports it.

Returns:
The <revXMLRPC_CreateRequest> <function(control_st)> returns a document ID which can be used to refer to the request in other <XML-RPC library> <command|commands> and <function(glossary)|functions>. The request ID is always a positive <integer>.
If the function encounters an error while parsing the data, it returns an error message beginning with "xmlrpcerr".

Description:
Use the <revXMLRPC_CreateRequest> <function(control_st)> to create an <XML-RPC document> that you can use with other <XML-RPC library> <command|commands> and <function(glossary)|functions>.

If the <host> is empty, the <revXMLRPC_CreateRequest> <function(control_st)> defaults the request host to be the computer runnning the application, also known as "localhost"

If the <port> is empty, the <revXMLRPC_CreateRequest> <function(control_st)> defaults the request port to 80, which is the default port for <HTTP> connections.

If the <path> is empty, the <revXMLRPC_CreateRequest> <function(control_st)> defaults the request path to "RPC2", which is the standard path for XML-RPC server resources.

If the <protocol> is empty, the <revXMLRPC_CreateRequest> <function(control_st)> defaults the request protocol to <HTTP> connections.

If the <revXMLRPC_CreateRequest> <function(control_st)> encounters an error, it <return|returns> an error message starting with "xmlrpcerr".

>*Important:*  The <revXMLRPC_CreateRequest> <function(control_st)> is part of the <XML-RPC library>. To ensure that the <function(control_st)> 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: integer (keyword), http (keyword), XML-RPC library (library), Revolution custom library (library), revXMLRPC_SetProtocol (command), revXMLRPC_SetPath (command), revXMLRPC_SetPort (command), revXMLRPC_SetSocket (command), revXMLRPC_DeleteAllDocuments (command), revXMLRPC_GetHost (function), return (glossary), XML-RPC request (glossary), Standalone Application Settings (glossary), XML-RPC document (glossary), standalone application (glossary), function (glossary), command (glossary), function (control_st)

Tags: networking
