Difference between revisions of "User:Opensource Obscure/http"

From Second Life Wiki
Jump to navigation Jump to search
m
m (templatizationingsx)
 
(6 intermediate revisions by the same user not shown)
Line 1: Line 1:
[[User:Opensource_Obscure|BACK to User:Opensource_Obscure]]
{{User:Opensource_Obscure/Backlink}}


With this script, a prim requests a new LSL Server public URL, then makes a http call that updates a db with the prim's public URL.
* [[User:Opensource Obscure/http/gridurl-sample]] a sample script that shows how to use Gridurl to get persistent URLs while using LSL HTTP Server.
<br>This is probably horrible, I can't code, don't use this if you don't know what you're doing.
* [[User:Opensource_Obscure/Chromutate]] a web-based, dynamic installation that can be controlled from a web page. Uses Gridurl.


<lsl>
Old projects (deprecated):
default
* [[User:Opensource_Obscure/http/snurl-sample]]
{
* [[User:Opensource_Obscure/http/text-db]]
    state_entry()
    {
llSay(0, "clean this script!");
        llRequestURL();   
    }
    http_request(key id, string method, string body)
    {
        if (method == URL_REQUEST_GRANTED)
        {
            a = body;
            llOwnerSay("chiamo: " + url+a);
            llSetObjectDesc(a);
            http_request_id = llHTTPRequest(url+a, [HTTP_METHOD, "POST"], "");           
        }
        else if (method == URL_REQUEST_DENIED)
        {
            llOwnerSay("Something went wrong, no url. " + body);
        }
        else if (method == "GET")
        {
            string text = llGetHTTPHeader(id, "x-query-string");
            llSetText(text, <1,1,1>, 1);
            llHTTPResponse(id,200,"OK! Please click BACK in your browser");
            llSay(0, "called by web");
        }
        else
        {
            llHTTPResponse(id,405,"Unsupported Method");
        }
    }
    touch_start(integer total_number)
    {
        llOwnerSay("MY URL: " + a);
        llSetObjectDesc(a);       
        http_request_id = llHTTPRequest(url+a, [], "");         
    }
    http_response(key request_id, integer status, list metadata, string body)
    {
        if (request_id == http_request_id)
        {
            // llInstantMessage(llGetOwner(), body);
        }
    }       
}
 
</lsl>

Latest revision as of 04:13, 22 April 2011

Go back to Opensource Obscure's userpage



Old projects (deprecated):