llRequestSecureURL

From Second Life Wiki
Revision as of 02:52, 31 July 2012 by Kireji Haiku (talk | contribs)
Jump to navigation Jump to search

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_START)
           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>

See Also

Functions

•  llRequestURL
•  llGetFreeURLs
•  llReleaseURL
•  llHTTPResponse
•  llGetHTTPHeader

Articles

•  LSL http server

Deep Notes

History

Signature

function key llRequestSecureURL();