llHTTPRequest
LSLkey llHTTPRequest(string url, list parameters, string body)
Sends an HTTP request to the specified URL with the Body of the request and Parameters.\ Returns a key that is a handle identifying the HTTP request made.
Parameters
| Type | Name | What it does |
|---|---|---|
| string | url | The address. |
| list | parameters | HTTP_METHOD, HTTP_MIMETYPE, HTTP_BODY_MAXLENGTH, HTTP_VERIFY_CERT … as key/value pairs. |
| string | body | The request body for POST/PUT, "" for GET. |
Example
key req;
default
{
touch_start(integer n)
{
req = llHTTPRequest("https://example.com/api/time", [HTTP_METHOD, "GET"], "");
}
http_response(key id, integer status, list meta, string body)
{
if (id != req) return;
if (status == 200) llSay(0, "Server said: " + body);
else llSay(0, "HTTP " + (string)status);
}
}
Energy
10
The Linden Scripting Library — what every SL-compatible grid provides.