Difference between revisions of "LlHTTPResponse"

From Second Life Wiki
Jump to navigation Jump to search
m
Line 1: Line 1:
{{LSL_Function|func_id
{{LSL_Function
|mode=request
|func_id=348|func_sleep=0.0|func_energy=10.0
|func=llHTTPResponse
|func=llHTTPResponse
|func_sleep=0.2
|func_energy=10.0
|func_desc=Sends a reply to an HTTP request.
|sort=HTTPResponse
|p1_type=key|p1_name=request_id|p1_desc=A valid HTTP request key.
|p1_type=key|p1_name=request_id|p1_desc=A valid HTTP request key.
|p2_type=list|p2_name=parameters|p2_desc=HTTP response parameters in the format
|p2_type=integer|p2_name=status|p2_desc=HTTP Status (200, 400, 404, etc)
[param1, value1, param2, value2, . . . paramN, valueN]
|p3_type=string|p3_name=body|p3_desc=Contents of the response.
|p3_type=string|p3_name=body|p3_desc=Contents of the response.
|func_footnote=The response need not been inside the [[http_request]] event but if it does not happen in a timely fashion the request will time out.
|func_desc=Responds to '''request_id''' with '''status''' and '''body'''.
|return_text
|spec
|caveats
|constants
|constants
|caveats
|examples=
|examples=<pre>
default
{
    http_request(key request_id, string method, string path_info, list parameters, string body)
    {
        // Loop Back Request Data
        llHTTPResponse(request_id, parameters, body);
    }
}
</pre>
|helpers
|helpers
|also_header
|also_functions=
|also_events={{LSL DefineRow||[[http_request]]}}
{{LSL DefineRow||[[llGetFreeURLs]]}}
{{LSL DefineRow||[[http_server]]}}
{{LSL DefineRow||[[llRequestURL]]}}
|also_functions={{LSL DefineRow||[[llHTTPServer]]|For opening an llHTTPServer.}}
{{LSL DefineRow||[[llRequestSecureURL]]}}
{{LSL DefineRow||[[llHTTPServerRemove]]|For removing the current HTTP server from a script.}}
{{LSL DefineRow||[[llReleaseURL]]}}
{{LSL DefineRow||[[llGetHTTPServerURL]]|For retrieving the current HTTP server URL.}}
{{LSL DefineRow||[[llGetHTTPHeader]]}}
{{LSL DefineRow||[[llEscapeURL]]}}
|also_tests
{{LSL DefineRow||[[llUnescapeURL]]}}
|also_events=
|also_footer
{{LSL DefineRow||[[http_request]]}}
|notes=This function is used to reply to HTTP requests received via the [[http_request]] event.<br /><br />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 requests:<br />[http://jira.secondlife.com/browse/SVC-913 SVC-913]<br />[http://jira.secondlife.com/browse/SVC-1086 SVC-1086]<br />Please go vote if this feature is important to you.
|also_articles=
|cat1=
{{LSL DefineRow||[[LSL http server]]}}
|notes
|deepnotes=
|history=
*{{SVN|1836|rev=112899 |trunk=*|anchor=file22|ver=|ser=}}
|cat1=HTTP
|cat2
|cat3
|cat4
}}
}}

Revision as of 20:39, 27 February 2009

Summary

Function: llHTTPResponse( key request_id, integer status, string body );

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 been inside the http_request event but if it does not happen in a timely fashion the request will time out.

Examples

See Also

Events

•  http_request

Functions

•  llGetFreeURLs
•  llRequestURL
•  llRequestSecureURL
•  llReleaseURL
•  llGetHTTPHeader

Articles

•  LSL http server

Deep Notes

History

Search JIRA for related Issues

Signature

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