<doc>
  <legacy_id>1211</legacy_id>
  <name>revXMLRPC_CreateRequest</name>
  <type>function</type>
  <syntax>
    <example>revXMLRPC_CreateRequest([<i>host</i>],[<i>port</i>],[<i>path</i>],[<i>protocol</i>])</example>
  </syntax>
  <library>XML-RPC library</library>
  <objects>
  </objects>
  <synonyms>
  </synonyms>
  <classification>
    <category>Text and Data Processing</category>
    <category>Networks &amp; Communication</category>
  </classification>
  <references>
    <command tag="revXMLRPC_SetSocket">revXMLRPC_SetSocket Command</command>
    <command tag="revXMLRPC_SetProtocol">revXMLRPC_SetProtocol Command</command>
    <command tag="revXMLRPC_SetPort">revXMLRPC_SetPort Command</command>
    <command tag="revXMLRPC_DeleteAllDocuments">revXMLRPC_DeleteAllDocuments Command</command>
    <command tag="revXMLRPC_SetPath">revXMLRPC_SetPath Command</command>
    <function tag="revXMLRPC_GetHost">revXMLRPC_GetHost Function</function>
  </references>
  <history>
    <introduced version="2.5">Added.</introduced>
  </history>
  <platforms>
    <mac/>
    <windows/>
    <linux/>
  </platforms>
  <classes>
    <desktop/>
    <server/>
    <web/>
  </classes>
  <security>
    <disk access="???"/>
    <process/>
  </security>
  <summary>Creates an <glossary tag="XML-RPC document">XML-RPC request</glossary> structure, optionally setting its host, port, path and protocol.</summary>
  <examples>
    <example>get revXMLRPC_CreateRequest(field "Host",field "Port",field "Path",field "Protocol")</example>
    <example>put revXMLRPC_CreateRequest("example.com",80,"RPC2","http") into theRequest</example>
  </examples>
  <description>
    <p>Use the <b>revXMLRPC_CreateRequest</b> <control_st tag="function">function</control_st> to create an <glossary tag="XML-RPC document">XML-RPC document</glossary> that you can use with other <glossary tag="XML-RPC library">XML-RPC library</glossary> <glossary tag="command">commands</glossary> and <glossary tag="function">functions</glossary>.</p><p/><p><b>Parameters:</b></p><p>The <i>host</i> is the <glossary tag="IP address">IP address</glossary> or <glossary tag="domain name">domain name</glossary> of the <glossary tag="host">host</glossary> you want to connect to.</p><p/><p>The <i>port</i> is the <glossary tag="port">port</glossary> 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 <keyword tag="http">HTTP</keyword> connections.)</p><p/><p>The <i>path</i> is usually a file path, which allows the <glossary tag="host">host</glossary> to determine which resource handles your request.</p><p/><p>The <i>protocol</i> determines the type of connection that is established with the host. By default, XML-RPC uses <keyword tag="http">HTTP</keyword> connections, but for added security you can use <keyword tag="https">HTTPS</keyword> connections, if the host supports it.</p><p/><p><b>Value:</b></p><p>The <b>revXMLRPC_CreateRequest</b> <control_st tag="function">function</control_st> returns a document ID which can be used to refer to the request in other <glossary tag="XML-RPC library">XML-RPC library</glossary> <glossary tag="command">commands</glossary> and <glossary tag="function">functions</glossary>. The request ID is always a positive <keyword tag="integer">integer</keyword>.</p><p/><p>If the function encounters an error while parsing the data, it returns an error message beginning with "xmlrpcerr".</p><p/><p><b>Comments:</b></p><p>If the <i>host</i> is empty, the <b>revXMLRPC_CreateRequest</b> <control_st tag="function">function</control_st> defaults the request host to be the computer runnning the application, also known as "localhost"</p><p/><p>If the <i>port</i> is empty, the <b>revXMLRPC_CreateRequest</b> <control_st tag="function">function</control_st> defaults the request port to 80, which is the default port for <keyword tag="http">HTTP</keyword> connections.</p><p/><p>If the <i>path</i> is empty, the <b>revXMLRPC_CreateRequest</b> <control_st tag="function">function</control_st> defaults the request path to "RPC2", which is the standard path for XML-RPC server resources.</p><p/><p>If the <i>protocol</i> is empty, the <b>revXMLRPC_CreateRequest</b> <control_st tag="function">function</control_st> defaults the request protocol to <keyword tag="http">HTTP</keyword> connections.</p><p/><p>If the <b>revXMLRPC_CreateRequest</b> <control_st tag="function">function</control_st> encounters an error, it <glossary tag="return">returns</glossary> an error message starting with "xmlrpcerr".</p><p/><p><code/><img src="202653"/> <b>Important!</b><code/> The <b>revXMLRPC_CreateRequest</b> <control_st tag="function">function</control_st> is part of the <glossary tag="XML-RPC library">XML-RPC library</glossary>. To ensure that the <control_st tag="function">function</control_st> works in a <glossary tag="standalone application">standalone application</glossary>, you must include this <glossary tag="LiveCode custom library">custom library</glossary> when you create your <glossary tag="standalone application">standalone</glossary>. In the Inclusions section on the General screen of the <glossary tag="Standalone Application Settings">Standalone Application Settings</glossary> window, make sure "XML-RPC Library" is selected in the list of script libraries.</p>
  </description>
</doc>