Difference between revisions of "Http request"
Jump to navigation
Jump to search
m |
m |
||
Line 1: | Line 1: | ||
{{LSL Generic/preview}}{{LSL_Event|event_id | {{LSL Generic/preview}}{{LSL_Event|event_id | ||
|event=http_request|event_id=33|event_delay | |||
|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 |
Revision as of 20:56, 27 February 2009
LSL Portal | Functions | Events | Types | Operators | Constants | Flow Control | Script Library | Categorized Library | Tutorials |
Note! Preview Documentation
This only exists on the preview grid
Description
Event: http_request( key request_id, string method, string body ){ ; }33 | Event ID |
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.
Caveats
Examples
See LSL_http_server/examples for some examples from the feature design phase. <lsl>default {
state_entry() { llRequestURL(); } http_request(key id, string method, string body) { 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); } }
}</lsl>
See Also
Functions
• | llRequestURL | – | Request a new LSL Server public URL | |
• | llRequestSecureURL | – | Request a new LSL Server public URL | |
• | llReleaseURL | – | Release a URL | |
• | llHTTPResponse | – | For replying to HTTP requests | |
• | llGetHTTPHeader | – | Returns the requested HTTP header's value | |
• | llEscapeURL | |||
• | llUnescapeURL |