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.
More in LSL
void llSay(integer channelID, string text)
integer llIsFriend(key agent_id)
void llSensor(string name, string id, integer type, float range, float arc)
list llParseString2List(string str, list separators, list spacers)
key llRequestURL()
void llSensorRemove()
key llGetLinkKey(integer linknum)
key llUpdateKeyValue(string key, string value, integer check, string original)