Name: libURLFormData

Type: function

Syntax: libURLFormData(<key1>, <value1> [, <key2>, <value2> ...])

Summary:
<libURLFormData> formats data in the standard format suitable for
sending to form processing CGIs and other processes on a web server.

Associations: internet library

Introduced: 2.5

OS: mac, windows, linux, html5

Platforms: desktop, server

Security: network

Example:
put "John" into tName
put "Hello" into tMessage
get libURLFormData("name", tName,"message", tMessage)
post it to url "http://www.someserver.com/cgi-bin/form.pl"
-- In this case, the data posted to the url will look like this: name=John&message=Hello

Parameters:
key1:
value1:
key2:
value2:


Description:
The function accepts variable numbers of parameters and treats them as
key-value pairs. The first parameter is the name of the first form part,
the second the value of the first part, the third is the name of the
second part, and so on.

>*Note:* The Content-Type header is set to
> "Content-Type: application/x-www-form-urlencoded" by default when
> using post. There is no need to set the httpHeaders unless you have
> previously set the Content-Type header to something else.

>*Important:* The <libURLFormData> <function> is part of the 
> <Internet library>. To ensure that the <function> works in a 
> <standalone application>, you must include this 
> <LiveCode custom library|custom library> when you create your 
> <standalone application|standalone>. In the Inclusions pane of the 
> <Standalone Application Settings> window, make sure the "Internet" 
> script library is selected.

References: post (command), libURLSetExpect100 (command),
libURLMultipartFormAddPart (function), libURLMultipartFormData (function),
application (glossary), standalone application (glossary),
function (glossary), main stack (glossary), keyword (glossary), 
group (glossary), Standalone Application Settings (glossary),
message (glossary), handler (glossary), LiveCode custom library (glossary),
Internet library (library), library (library), openBackground (message),
openStack (message), startup (message), preOpenStack (message),
preOpenCard (message)

