LSL HTTP server/examples

From Second Life Wiki
< LSL HTTP server
Revision as of 15:50, 18 July 2008 by Kelly Linden (talk | contribs) (New page: === Hello World! === Classic example. <lsl> default { state_entry() { llRequestPublicURL(); } http_request(key id, string method, string body) { if (me...)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Hello World!

Classic example. <lsl> default {

   state_entry()
   {
       llRequestPublicURL();
   }
   http_request(key id, string method, string body)
   {
       if (method == URL_REQUEST_GRANTED)
       {
           llSay(0,"URL: " + body);
       }
       else if (method == URL_REQUEST_DENIED)
       {
           llSay(0, "Something went wrong, no url. " + body);
       }
       else if (method == "GET")
       {
           llHTTPResponse(id,200,"Hello World!");
       }
   }

} </lsl>