https | |||||||
Type | keyword | ||||||
Dictionary | LCS | ||||||
Library | LiveCode Script | ||||||
Syntax |
| ||||||
Associations | internet library | ||||||
Summary | Used as a URL type with such commands as put and get to designate a file on the World Wide Web. | ||||||
Introduced | 2.5 | ||||||
OS | mac, windows, linux, ios, android | ||||||
Platforms | desktop, server, mobile | ||||||
Example |
| ||||||
Values |
| ||||||
Related | Message: startup, openBackground, preOpenStack, openStack, preOpenCard Library: Internet library, library Keyword: URL, file, ftp, button, word, http Control Structure: function Function: result, files, libURLErrorData, value Command: post, put, load, group, delete URL, get, libURLSetCustomHTTPHeaders Glossary: LiveCode custom library, application, standalone application, evaluate, server, blocking, cache, statement, URL, command, container, expression, main stack, keyword, Standalone Application Settings, upload, download, message, flag, handler | ||||||
Security | network | ||||||
Description | Use the http keyword to work with files on the Web. The URL scheme "http" indicates information located on a web server. An http URL consists of:
Here are some examples of valid https URLs: * 'https://www.example.com' : The main page for the server "www.example.com" * 'https://www.example.com/directory/' : A directory on the server * 'https://www.example.com/directory/file.html' : A file on the server * 'https://user:password@www.example.com/file.txt' : A file accessed by a user name and password * 'https://www.example.com/directory/stuff.html?list=yes' : A page generated by a query - possibly generated by a CGI
An http URL is a container, and you can use the expression URL httpURL in any statement where any other container type is used. When you get the value of an http URL, LiveCode downloads the URL from the server. (If you have previously cached the URL with the load command, it fetches the URL from the cache.)
The following example shows how to set a flag in a global variable to prevent multiple downloads. The variable "gDownloadInProgress" is set to true while a download is going on, and back to false when the download concludes. If the user clicks the button again while the download is still going on, the handler simply beeps:
For technical information about URLs and the https URL scheme, see RFC 1630.
*Cross-platform note:* On iOS and Android, you can use the https keyword without the need for the Internet library. When specifying URLs for iOS and Android, you must use the appropriate form that conforms to RFC 1630. |