Difference between revisions of "Http request"

From Second Life Wiki
Jump to navigation Jump to search
Line 1: Line 1:
{{LSL_Event|event_id
{{LSL Generic/preview}}{{LSL_Event|event_id
|mode=request
|mode=preview
|event_delay|event=http_request
|event=http_request|event_id|event_delay
|p1_type=key|p1_name=request_id|p1_desc=HTTP request id for response use.
|p1_type=key|p1_name=request_id|p1_desc=HTTP request id for response use.
|p2_type=string|p2_name=method|p2_desc=GET,POST,PUT
|p2_type=string|p2_name=method|p2_desc=GET, POST, PUT
|p3_type=string|p3_name=path_info|p3_desc=
|p3_type=string|p3_name=body|p3_desc=Contents of the request.
|p4_type=list|p4_name=params|p4_desc=HTTP request parameters in the format<br />[param1, value1, param2, value2, . . . paramN, valueN]
|p5_type=string|p5_name=body|p5_desc=Contents of the request.
|event_desc=Triggered when task receives an HTTP request.
|event_desc=Triggered when task receives an HTTP request.
|constants=
|constants=
|spec
|spec=See [[LSL_http_server]] for full specification.
|caveats
|caveats
|examples=<pre>
|examples=<lsl>default
default
{
{
     http_request(key request_id, string method, string path_info, list parameters, string body)
     http_request(key request_id, string method, string body)
     {
     {
         // Loop Back Request Data
         // Loop Back Request Data
         llHTTPResponse(request_id, parameters, body);
         llHTTPResponse(request_id, 200, body);
     }
     }
}
}</lsl>
</pre>
|helpers
|helpers
|also_header
|also_articles=
|also_events={{LSL DefineRow||[[http_server]]}}
|also_events
|also_functions={{LSL DefineRow||[[llHTTPServer]]|For opening an llHTTPServer.}}
|also_functions=
{{LSL DefineRow||[[llHTTPServerRemove]]|For removing the current HTTP server from a script.}}
{{LSL DefineRow||[[llRequestURL]]|Request a new LSL Server public URL}}
{{LSL DefineRow||[[llGetHTTPServerURL]]|For retrieving the current HTTP server URL.}}
{{LSL DefineRow||[[llHTTPResponse]]|For replying to HTTP requests}}
{{LSL DefineRow||[[llHTTPResponse]]|For replying to HTTP requests.}}
{{LSL DefineRow||[[llGetHTTPHeader]]|Returns the requested HTTP header's value}}
{{LSL DefineRow||[[llEscapeURL]]}}
{{LSL DefineRow||[[llEscapeURL]]}}
{{LSL DefineRow||[[llUnescapeURL]]}}
{{LSL DefineRow||[[llUnescapeURL]]}}
|also_footer
|also_footer
|notes=Zero Linden's Office Hours Discussion On Incoming HTTP: [https://wiki.secondlife.com/wiki/User:Zero_Linden/Office_Hours/Discussion#Incoming_HTTP]<br />PJIRA feature request at [http://jira.secondlife.com/browse/SVC-913 SVC-913]<br />Please go vote if this feature is important to you.
|notes=
|cat1
|cat1
}}
}}

Revision as of 18:34, 24 October 2008

  Note! Preview Documentation

This only exists on the preview grid

Description

Event: http_request( key request_id, string method, string body ){ ; }

Triggered when task receives an HTTP request.

• key request_id HTTP request id for response use.
• string method GET, POST, PUT
• string body Contents of the request.

Specification

See LSL_http_server for full specification.

Examples

<lsl>default {

   http_request(key request_id, string method, string body)
   {
       // Loop Back Request Data
       llHTTPResponse(request_id, 200, body);
   }

}</lsl>

See Also

Functions

•  llRequestURL Request a new LSL Server public URL
•  llHTTPResponse For replying to HTTP requests
•  llGetHTTPHeader Returns the requested HTTP header's value
•  llEscapeURL
•  llUnescapeURL

Deep Notes

Signature

event void http_request( key request_id, string method, string body );