post | ||||||||||
Type | command | |||||||||
Dictionary | LCS | |||||||||
Library | LiveCode Script | |||||||||
Syntax |
| |||||||||
Associations | internet library | |||||||||
Summary | Sends data to a web server using the POST action of HTTP. | |||||||||
Introduced | 1.0 | |||||||||
OS | mac, windows, linux, ios, android | |||||||||
Platforms | desktop, server, mobile | |||||||||
Parameters |
| |||||||||
Example |
| |||||||||
Values |
| |||||||||
Related | Property: httpHeaders, HTTPProxy Message: urlProgress Library: Internet library Keyword: URL, ftp, http Control Structure: function Function: result, URLStatus, URLEncode, libURLFormData, URLDecode, libURLMultipartFormAddPart, libURLMultipartFormData Command: post, write to socket, delete URL, read from socket, put, libURLSetExpect100, libURLSetLogField, open socket, libURLSetCustomHTTPHeaders Glossary: variable, command, LiveCode custom library, property, standalone application, blocking, web server, command, expression, syntax, server, upload, statement, handler, Standalone Application Settings | |||||||||
Security | network | |||||||||
Description | Use the post command to submit data to a web server. Data you send should be encoded using the URLEncode function. The HTTP header sent with the POST request can be changed using either the HTTPHeaders property or the libURLSetCustomHTTPHeaders command. By default, the "Content-Type" header line is set to "application/x-www-form-urlencoded".
To send a username and password with the post command, use the standard syntax for including this information in a URL. For example, to access http://www.example.com/ with the username "me" and the password "pass", use the following statement :
*Cross-platform note:* On iOS and Android, the post command is implemented in the engine. Therefore the Internet library is not needed to ensure the command works in a mobile standalone application. If included, the Internet library implementation will be used instead of the engine implementation. Note: The Android and iOS engines do not support 'libUrl' but do allow you to use post in the background. When specifying URLs for Android or iOS, you must use the appropriate form that conforms to RFC 1738. Ensure that you URLEncode any username and password fields appropriately for FTP URLs. |