Difference between revisions of "LlRequestSecureURL"

From Second Life Wiki
Jump to navigation Jump to search
m (remove preview note)
m (added example)
Line 10: Line 10:
|constants
|constants
|examples=
|examples=
Requesting a secure URL.
<lsl>
key urlRequestId;
string secureUrl;
request_secure_url()
{
    if (secureUrl != "")
    {
        llReleaseURL(secureUrl);
        secureUrl = "";
    }
    urlRequestId = llRequestSecureURL();
}
default
{
    changed(integer change)
    {
        if (change & (CHANGED_REGION | CHANGED_REGION_START | CHANGED_TELEPORT))
            request_secure_url();
    }
    state_entry()
    {
        request_secure_url();
    }
    http_request(key id, string method, string body)
    {
        if (id == urlRequestId)
        {
            urlRequestId = NULL_KEY;
            if (method == URL_REQUEST_GRANTED)
            {
                secureUrl = body;
                llOwnerSay(secureUrl);
            }
            else if (method == URL_REQUEST_DENIED)
                llOwnerSay("URL request has been denied! " + body);
        }
        else if (method == "GET")
            llHTTPResponse(id, 200, "Hello world!");
    }
}
</lsl>
|helpers
|helpers
|mode=
|mode=

Revision as of 02:21, 31 July 2012

Summary

Function: key llRequestSecureURL( );
0.0 Forced Delay
10.0 Energy

Requests one HTTPS:// (SSL) url for use by this object. The http_request event is tiggered with results.
Returns a key that is the handle used for identifying the request in the http_request event.

Caveats

  • When a region is (re)started all HTTP server URLs are automatically released and invalidated.

Examples

Requesting a secure URL. <lsl> key urlRequestId; string secureUrl;

request_secure_url() {

   if (secureUrl != "")
   {
       llReleaseURL(secureUrl);
       secureUrl = "";
   }
   urlRequestId = llRequestSecureURL();

}

default {

   changed(integer change)
   {
if (change & (CHANGED_REGION

See Also

Functions

•  llRequestURL
•  llGetFreeURLs
•  llReleaseURL
•  llHTTPResponse
•  llGetHTTPHeader

Articles

•  LSL http server

Deep Notes

History

Signature

function key llRequestSecureURL();