Http request
From Second Life Wiki
Http request
| Languages: |
English |
| LSL Portal | | | Functions | | | Events | | | Types | | | Operators | | | Constants | | | Flow Control | | | Script Library | | | Tutorials |
This only exists on the preview grid
(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. |
Examples
See LSL_http_server/examples for some examples from the feature design phase.
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); } } }
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 |

