libURLSetCustomHTTPHeaders | |||||||
Type | command | ||||||
Dictionary | LCS | ||||||
Library | LiveCode Script | ||||||
Syntax |
| ||||||
Associations | internet library | ||||||
Summary | Sets the headers to be sent with each request to an HTTP server. | ||||||
Introduced | 1.1.1 | ||||||
OS | mac, windows, linux, web | ||||||
Platforms | desktop, server | ||||||
Parameters |
| ||||||
Example |
| ||||||
Related | Property: httpHeaders Message: startup, openBackground, preOpenStack, openStack, preOpenCard Library: Internet library, library Keyword: https, URL, default, http Glossary: LiveCode custom library, application, standalone application, property, web server, command, expression, main stack, Standalone Application Settings, server, HTTP, message, handler Function: libURLLastHTTPHeaders Command: post, libURLSetCustomHTTPHeaders, group | ||||||
Security | network | ||||||
Description | Use the libURLSetCustomHTTPHeaders command to implement an HTTP method other than GET, POST, DELETE, or PUT. Whenever LiveCode contacts a web server (with the load command, the post command, or by using an HTTP URL in an expression), the headersList is sent to the web server. Usually, the headersList will include multiple lines. A typical headersList might look like the following example:
Connection:Close User-Agent: My Fancy Browser Host:www.cats-training.com Accept:image/gif, image/x-xbitmap, image/jpeg, image/png, / Accept-Encoding: gzip Accept-Charset: iso-8859-1,*,utf-8 The libURLSetCustomHTTPHeaders setting takes effect for the next HTTP transaction. After the transaction, the headers are set back to the default. This means that if you want to do multiple HTTP transactions using the same set of custom headers, you must use the libURLSetCustomHTTPHeaders command before each transaction. The libURLSetCustomHTTPHeaders setting replaces the Internet library|Internet library's default headers. To add to the default headers instead of replacing them, use the httpHeaders property instead. If you specify a set of headers using the libURLSetCustomHTTPHeaders command, the Internet library's default headers and the setting of the httpHeaders property are ignored, and the headers set by libURLSetCustomHTTPHeaders are used instead.
For technical information about the standard headers recognized in the HTTP 1.1 protocol, see RFC 2616. | ||||||
Tags | networking |