DOWNTIME ANNOUNCEMENT - Maintenance will be performed from 1AM-3AM Pacific Time on 2010-03-20 (tonight). Please do not edit any pages during this time.

Looking for Viewer 2 Beta help? Right this way!

LlHTTPResponse

From Second Life Wiki

Jump to: navigation, search

Template:Needs Translation/LSL/de Template:Needs Translation/LSL/es Template:Needs Translation/LSL/el Template:Needs Translation/LSL/fr Template:Needs Translation/LSL/he Template:Needs Translation/LSL/it Template:Needs Translation/LSL/ja Template:Needs Translation/LSL/ko Template:Needs Translation/LSL/nl Template:Needs Translation/LSL/hu Template:Needs Translation/LSL/no Template:Needs Translation/LSL/da Template:Needs Translation/LSL/sv Template:Needs Translation/LSL/tr Template:Needs Translation/LSL/pl Template:Needs Translation/LSL/pt Template:Needs Translation/LSL/ru Template:Needs Translation/LSL/uk Template:Needs Translation/LSL/zh-Hans Template:Needs Translation/LSL/zh-Hant

Contents

Summary

Function: llHTTPResponse( key request_id, integer status, string body );
348 Function ID
0.0 Delay
10.0 Energy

Responds to request_id with status and body.

• key request_id A valid HTTP request key.
• integer status HTTP Status (200, 400, 404, etc)
• string body Contents of the response.

The response need not be made inside the http_request event but if it does not happen in a timely fashion the request will time out (within 25 seconds).

Caveats

  • This call must be made by the script containing the http_request event where the request_id was received.
  • Remember that the body of http_request is limited to 2048 bytes, so if responding to an SL object, anything over 2K characters sent with this function will be lost at the receiver.

Search JIRA for related Bugs

Examples

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

See Also

Events

•  http_request

Functions

•  llGetFreeURLs
•  llRequestURL
•  llRequestSecureURL
•  llReleaseURL
•  llGetHTTPHeader

Articles

•  LSL http server
This article wasn't helpful for you? Maybe the related article at the LSL Wiki is able to bring enlightenment.
Personal tools
In other languages