User:Vegas Silverweb/llHTTPRequest Pro Tip(s)

From Second Life Wiki
Jump to: navigation, search

Pro Tip!

llHTTPRequest can return null key. Means you're llHTTPRequest-ing too fast, generally. To keep it reliable, you need to do something like this:

<lsl>

    key req;
        while(NULL_KEY == req=llHTTPRequest("http://example.com/",[],"")) {
           llOwnerSay("uh oh throttle");
           llSleep(5.0);
           
           }

</lsl>

The sleep should probably be longer, perhaps 20 seconds. Even better, defer the HTTP request for 10 or 20 seconds with a timer so your event queue can be serviced while the llHTTPRequest throttle is in effect.