Fandom

Livecode Wiki

LibURLFormData

1,968pages on
this wiki
Add New Page
Comments0 Share

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

Syntax:

libURLFormData(key_1, value_1, ..., key_n, value_n)

Examples:

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

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.

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.

See: Internet library

See Also: libURLMultipartFormAddPart Function, libURLMultipartFormData Function, post Command, libURLSetExpect100 Command

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.