LassoScript Utility
Basics Browse Detail

[Include_URL]

Tag Link [Include_URL] Category Include
Type Substitution Source Available No
Support Preferred Version 3.0
Change Unchanged Data Source Any
Output Type Bytes Security Tag
Implementation LCAPI Sets Lasso 8.5, Lasso 8.0, Lasso 7.0, Lasso 6.0, Lasso 5.0, Lasso 3.x

Description

[Include_URL] includes a Web page, image, or other resource from a remote HTTP or HTTPS server. The downloaded data can be displayed in the current format file, processed, or served.

The URL parameter is required. It should be a valid URL and may contain GET parameters. The remote page will be fetched and the response will be returned as the result of the tag.

All other parameters are optional and change the information that is sent to and received from the remote server.

-NoData sends the URL to the remote server, but ignores the reply. The tag returns nothing.

-Username and -Password allow authentication information to be sent along with the URL. The authentication information will be sent to the remote server just as if they had been typed into the authentication dialog of a Web browser.

-GETParams and -POSTParams allow an array of name/value pairs to be passed along with the URL to the remote server. GET parameters are appended to the end of the URL itself. POST parameters are submitted as if they were form elements. -POSTParams can also be passed a string which will be sent as the body of the POST. This allows XML data to be posted to remote servers for SOAP communications.

-SendMIMEHeaders allows an array of extra HTTP request headers to be passed along with the URL to the remote server.

-RetrieveMIMEHeaders allows an array of MIME headers sent back from the remote server in the HTTP response to be inspected. The -RetrieveMIMEHeaders parameter requires the name of a variable in which the array of headers will be stored.

-VerifyPeer can be used to perform a more rigorous check of the peer's SSL certificate if the HTTP protocol is being used.

Syntax

[Include_URL: 'http://www.example.com']

[Include_URL: 'http://www.example.com', -NoData]

[Include_URL: 'http://www.example.com',
-POSTParams=(Array: 'Name'='Value')]

[Include_URL: 'http://www.example.com',
-POSTParams='<xml> ... </xml>']

[Include_URL: 'http://www.example.com',
-GETParams=(Array: 'Name'='Value')]

[Include_URL: 'https://www.example.com',
-Username='Username',
-Password='Password']

[Include_URL: 'http://www.example.com',
-SendMIMEHeaders=(Array: 'Name'='Value')]

[Include_URL: 'http://www.example.com',
-RetrieveMIMEHeaders='Variable Name']

Parameters

Required Parameters
URL The URL which is to be included.
Optional Parameters
-POSTParams An optional array of pairs which will be passed as the POST parameters with the URL request. Or, a string that will be posted to the remote server.
-GETParams An optional array of pairs which will be passed as the GET parameters with the URL request.
-SendMIMEHeaders An optional array of pairs which will be sent as additonal MIME headers along with the URL request.
-RetrieveMIMEHeaders The optional name of a variable in which to store retrieved MIME headers.
-Username An optional username with which to authenticate the URL request.
-Password An optional password with which to authenticate the URL request.
-NoData If specified then the URL request is sent, but no results are returned.
Encoding Keyword Specifies the encoding for the tag's return value. Tags are encoded using -EncodeHTML by default if their value is output in a format file. No encoding is applied to nested tags unless an explicity encoding keyword is specified. One of -EncodeBreak, -EncodeHTML, -EncodeNone, -EncodeRaw, -EncodeSmart, -EncodeStrictURL, -EncodeURL, -EncodeXML.
-VerifyPeer If specified the tag performs a more rigorous check of the remote servers SSL certificate when the HTTP protocol is used.
-SSLCert The file path to your certificate. No Lasso security will be checked for this file path. The default certificate format is "PEM" and can be changed with -SSLCertType.
-SSLCertType The format of the SSL certificate specified by -SSLCert. Supported formats are "PEM" (the default) and "DER".
-SSLKey The file path to your private SSL key. No Lasso security will be checked for this file path. The default key format is "PEM" and can be changed with -SSLKeyType.
-SSLKeyType The format of the private key referenced by -SSLKey. Supported formats are "PEM" (the default) and "DER".
-SSLKeyPasswd The required password for the -SSLKey.
-Timeout This integer should contain the maximum time in seconds that you allow the connection to the server to take. This only limits the connection phase, once it has connected, this option is of no more use. Set to zero to disable connection timeout (it will then only timeout on the system's internal timeouts).
-ConnectTimeout This integer should contain the maximum time in seconds that you allow the connection to the server to take. This only limits the connection phase, once it has connected, this option is of no more use. Set to zero to disable connection timeout (it will then only timeout on the system's internal timeouts). Note: It seems that any connection timeouts on OS X will wait for only half the time specified.

Change Notes

The -VerifyPeer parameter was added in Lasso Professional 8.0.2. The behavior of [Include_URL] when this parameter is specified was the default prior to this release.

The SSL and timeout parameters were added in Lasso Professional 8.1.

Examples

To create a proxy for Web requests:

Pass an [Action_Param] to the [Include_URL] tag and return the results of that tag in place of the current format file. The following example simply returns the URL specified in a URL parameter to the format file.

[Include_URL: (Action_Param: 'URL')]

Related Tags

Category Tags