llHTTPResponse

From Second Life Wiki
Revision as of 00:07, 2 January 2014 by Strife Onizuka (talk | contribs)
Jump to navigation Jump to search

Summary

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

Responds to request_id with status and body.

• key request_id A valid HTTP request key.
• integer status "Wikipedia logo"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.
  • There is no limit, other than script size, to the amount of data that can be sent by this function.
    • llHTTPRequest can truncate the response length in receiving scripts. Be aware when using them together for prim-to-prim communications.
  • The response by default has 'content-type: text/plain'. Use llSetContentType to optionally return a different type, like 'text/html'.

Examples

<lsl> string url;

default {

   changed(integer change)
   {
if (change & (CHANGED_REGION_START

Deep Notes

History

Signature

function void llHTTPResponse( key request_id, integer status, string body );