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
integer llReplaceAgentEnvironment(key agent_id, float transition, string environment)
key llGetObjectLinkKey(key objectid, integer linknum)
float llGetTextureRot(integer side)
vector llGetCameraPos()
void llSetLinkTextureAnim(integer linknum, integer mode, integer face, integer sizex, integer sizey, float start, float length, float rate)
void llRemoteLoadScriptPin(string target, string name, integer pin, integer running, integer start_param)
list llGetBoundingBox(string obj)
void llApplyImpulse(vector force, integer local)