<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.secondlife.com/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=RenateIsabella+Resident</id>
	<title>Second Life Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.secondlife.com/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=RenateIsabella+Resident"/>
	<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/wiki/Special:Contributions/RenateIsabella_Resident"/>
	<updated>2026-04-05T22:04:38Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.42.1</generator>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=LlHTTPRequest&amp;diff=1197907</id>
		<title>LlHTTPRequest</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=LlHTTPRequest&amp;diff=1197907"/>
		<updated>2015-11-07T12:36:12Z</updated>

		<summary type="html">&lt;p&gt;RenateIsabella Resident: Additional info about http request throttling&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{LSL_Function&lt;br /&gt;
|func=llHTTPRequest&lt;br /&gt;
|func_id=230&lt;br /&gt;
|func_energy=10.0&lt;br /&gt;
|func_sleep=0.0&lt;br /&gt;
|func_desc=Sends an HTTP request to the specified URL with the body of the request and parameters. &lt;br /&gt;
|sort=HTTPRequest&lt;br /&gt;
|func_footnote=&lt;br /&gt;
|return_type=key|return_subtype=handle&lt;br /&gt;
|return_text=identifying the HTTP request made.&lt;br /&gt;
|p1_type=string|p1_name=url|p1_desc=A valid HTTP/HTTPS URL.&lt;br /&gt;
|p2_type=list|p2_subtype=instructions|p2_name=parameters|p2_desc=configuration parameters, specified as HTTP_* flag-value pairs&lt;br /&gt;
[ parameter1, value1, parameter2, value2, . . . parameterN, valueN]&lt;br /&gt;
|p3_type=string|p3_name=body|p3_desc=Contents of the request.&lt;br /&gt;
|constants={{LSL_Constants_HTTP}}&lt;br /&gt;
{{LSL_Constants/HTTP_Headers}}&lt;br /&gt;
|spec&lt;br /&gt;
|caveats=&lt;br /&gt;
*If there is a space in &#039;&#039;&#039;url&#039;&#039;&#039;, the [[http_response]] status code will be 499.&lt;br /&gt;
*The corresponding [[http_response]] event will be triggered in all scripts in the [[prim]], not just in the requesting script.&lt;br /&gt;
*Requests must fully complete after 60 seconds, or else the response will be thrown away and the [[http_response]] status code will be 499.&lt;br /&gt;
*The response body is limited to 2048 bytes by default, see [[HTTP_BODY_MAXLENGTH]] above to increase it. If the response is longer, it will be truncated.&lt;br /&gt;
*Requests are throttled on a per [[object]] basis (not per prim or script).&lt;br /&gt;
**Requests are throttled at approximately 25 requests per 20 seconds. This is to support a sustained rate of 1 per second or a max burst of up to 25 every 40 seconds (2x the interval for max burst), smaller bursts are recommended. (Edit: rcently (November 2015) scripts with considerably lower request frequencies than 25 per 20 seconds have been known to fail and it seems the limit has been reduced significantly. There doesn&#039;t seem to be any official statement about what the new limit is nor if it&#039;s a permanent change. For now it&#039;s recommended to keep the number of requests as low as possible and test scripts using llHTTPReqest throughly.)&lt;br /&gt;
**[[NULL_KEY]] is returned if the request is throttled.&lt;br /&gt;
***See [http://forums-archive.secondlife.com/139/72/108960/1.html this thread] and [http://forums-archive.secondlife.com/139/2c/109571/1.html this thread] for more details.&lt;br /&gt;
*Cannot be used to load textures or images from the internet, for more information see [[Web Textures]].&lt;br /&gt;
*If the accessed site is relying on the LSL script to report L$ transactions, then it &#039;&#039;&#039;must&#039;&#039;&#039; check the X-SecondLife-Shard header to see if the script is running on the beta grid.&lt;br /&gt;
* Some servers will return a 405 error if you send POST to a file that can&#039;t accept metadata, such as a text or HTML file. Make sure you use the GET method to ensure success in any environment.&lt;br /&gt;
* While the HTTP status code from the server is provided to the script, redirect codes such as 302 will result in the redirect being automatically and transparently followed ONLY IF the [[HTTP_METHOD]] is GET, with the resulting response being returned.  If the [[HTTP_METHOD]] is anything other then GET then you&#039;ll get back an http_response with a status code of 302, but without any way to view the headers, you can&#039;t know where you were being redirected to unless that was also included in the body.&lt;br /&gt;
* The following applies when making a request to a script using HTTP-In:&lt;br /&gt;
**When appending a query string to a cap URL there &#039;&#039;&#039;MUST&#039;&#039;&#039; be a trailing slash between the cap guid and the query string token &amp;lt;code&amp;gt;&amp;quot;?&amp;quot;&amp;lt;/code&amp;gt;. For example: [https://sim3015.aditi.lindenlab.com:12043/cap/a7717681-2c04-e4ac-35e3-1f01c9861322?arg=gra {{HoverTextStyle|style=color:green;|&amp;lt;nowiki&amp;gt;https://sim3015.aditi.lindenlab.com:12043/cap/a7717681-2c04-e4ac-35e3-1f01c9861322&amp;lt;/nowiki&amp;gt;|2={{String|x-script-url}} = {{String|https://sim3015.aditi.lindenlab.com:12043/cap/a7717681-2c04-e4ac-35e3-1f01c9861322}}}}?{{HoverTextStyle|style=color:red;|1=arg=gra|2={{String|x-query-string}} = {{String|1=arg=gra}}}}] will return a 500 HTTP status {{Wikipedia|List_of_HTTP_status_codes#5xx_Server_Error|Server Error code}}, but [https://sim3015.aditi.lindenlab.com:12043/cap/a7717681-2c04-e4ac-35e3-1f01c9861322/?arg=gra {{HoverTextStyle|style=color:green;|&amp;lt;nowiki&amp;gt;https://sim3015.aditi.lindenlab.com:12043/cap/a7717681-2c04-e4ac-35e3-1f01c9861322&amp;lt;/nowiki&amp;gt;|2={{String|x-script-url}} = {{String|https://sim3015.aditi.lindenlab.com:12043/cap/a7717681-2c04-e4ac-35e3-1f01c9861322}}}}{{HoverTextStyle|style=color:blue;|/|2={{String|x-path-info}} = {{String|/}}}}?{{HoverTextStyle|style=color:red;|1=arg=gra|2={{String|x-query-string}} = {{String|1=arg=gra}}}}] will succeed.&lt;br /&gt;
* X-SecondLife-Owner-Name may return &amp;quot;(Loading...)&amp;quot; instead of owner name (still true, 18th of July, 2011)&lt;br /&gt;
* Requests made at approx 0625 SLT may fail with a 503 status code, with &amp;quot;ERROR: The requested URL could not be retrieved&amp;quot;, and &amp;quot;(111) Connection refused&amp;quot; in the body of the response.  This has been confirmed as expected behaviour by Kelly, due to the nightly maint &amp;amp; log rotation.  It does reliably impact object to object HTTP at that time, and quite probably may impact object to/from web around the same time.  The interruption in service is fairly brief, and the precise timing may vary as LL adjust their nightly maint processes, or due to server load.&lt;br /&gt;
|examples=&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lsl2&amp;quot;&amp;gt;&lt;br /&gt;
key http_request_id;&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        http_request_id = llHTTPRequest(&amp;quot;url&amp;quot;, [], &amp;quot;&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    http_response(key request_id, integer status, list metadata, string body)&lt;br /&gt;
    {&lt;br /&gt;
        if (request_id != http_request_id) return;// exit if unknown&lt;br /&gt;
&lt;br /&gt;
        vector COLOR_BLUE = &amp;lt;0.0, 0.0, 1.0&amp;gt;;&lt;br /&gt;
        float  OPAQUE     = 1.0;&lt;br /&gt;
&lt;br /&gt;
        llSetText(body, COLOR_BLUE, OPAQUE);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Example PHP test script:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php header(&amp;quot;content-type: text/plain; charset=utf-8&amp;quot;); ?&amp;gt;&lt;br /&gt;
Headers received:&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
 * @author Wouter Hobble&lt;br /&gt;
 * @copyright 2008&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
foreach ($_SERVER as $k =&amp;gt; $v)&lt;br /&gt;
{&lt;br /&gt;
    if( substr($k, 0, 5) == &#039;HTTP_&#039;)&lt;br /&gt;
    {&lt;br /&gt;
        print &amp;quot;\n&amp;quot;. $k. &amp;quot;\t&amp;quot;. $v;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
example wrapper script Both capturing apache headers and global methodes&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?PHP&lt;br /&gt;
    // Author Waster Skronski.&lt;br /&gt;
    // General Public License (GPL).&lt;br /&gt;
    // Mind that some headers are not included because they&#039;re either useless or unreliable.&lt;br /&gt;
&lt;br /&gt;
    $USE_APACHE_HEADERS = TRUE;// switch to false if you need cgi methods&lt;br /&gt;
&lt;br /&gt;
    if ($USE_APACHE_HEADERS)&lt;br /&gt;
    {&lt;br /&gt;
        $headers    = apache_request_headers();&lt;br /&gt;
        $objectgrid = $headers[&amp;quot;X-SecondLife-Shard&amp;quot;];&lt;br /&gt;
        $objectname = $headers[&amp;quot;X-SecondLife-Object-Name&amp;quot;];&lt;br /&gt;
        $objectkey  = $headers[&amp;quot;X-SecondLife-Object-Key&amp;quot;];&lt;br /&gt;
        $objectpos  = $headers[&amp;quot;X-SecondLife-Local-Position&amp;quot;];&lt;br /&gt;
        $ownerkey   = $headers[&amp;quot;X-SecondLife-Owner-Key&amp;quot;];&lt;br /&gt;
        $ownername  = $headers[&amp;quot;X-SecondLife-Owner-Name&amp;quot;];&lt;br /&gt;
        $regiondata = $headers[&amp;quot;X-SecondLife-Region&amp;quot;];&lt;br /&gt;
        $regiontmp  = explode (&amp;quot;(&amp;quot;,$regiondata);        // cut cords off&lt;br /&gt;
        $regionpos  = explode (&amp;quot;)&amp;quot;,$regiontmp[1]);&lt;br /&gt;
        $regionname = substr($regiontmp[0],0,-1);       // cut last space from simname&lt;br /&gt;
    } else {&lt;br /&gt;
        $db         = $GLOBALS;&lt;br /&gt;
        $headers    = $db[&#039;HTTP_ENV_VARS&#039;];&lt;br /&gt;
        $objectgrid = $headers[&amp;quot;HTTP_X_SECONDLIFE_SHARD&amp;quot;];&lt;br /&gt;
        $objectname = $headers[&amp;quot;HTTP_X_SECONDLIFE_OBJECT_NAME&amp;quot;];&lt;br /&gt;
        $objectkey  = $headers[&amp;quot;HTTP_X_SECONDLIFE_OBJECT_KEY&amp;quot;];&lt;br /&gt;
        $ownerkey   = $headers[&amp;quot;HTTP_X_SECONDLIFE_OWNER_KEY&amp;quot;];&lt;br /&gt;
        $objectpos  = $headers[&amp;quot;HTTP_X_SECONDLIFE_LOCAL_POSITION&amp;quot;];&lt;br /&gt;
        $ownername  = $headers[&amp;quot;HTTP_X_SECONDLIFE_OWNER_NAME&amp;quot;];&lt;br /&gt;
        $regiondata = $headers[&amp;quot;HTTP_X_SECONDLIFE_REGION&amp;quot;];&lt;br /&gt;
        $regiontmp  = explode (&amp;quot;(&amp;quot;,$regiondata);&lt;br /&gt;
        $regionpos  = explode (&amp;quot;)&amp;quot;,$regiontmp[1]);&lt;br /&gt;
        $regionname = substr($regiontmp[0],0,-1);&lt;br /&gt;
    }&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Example wrapper script for GoDaddy.com Linux PHP servers (fix made by Thomas Conover):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
// FETCH HEADERS START&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
if (!function_exists(&#039;apache_request_headers&#039;))&lt;br /&gt;
{&lt;br /&gt;
    function apache_request_headers() {&lt;br /&gt;
        foreach($_SERVER as $key=&amp;gt;$value) {&lt;br /&gt;
            if (substr($key,0,5)==&amp;quot;HTTP_&amp;quot;) {&lt;br /&gt;
                $key=str_replace(&amp;quot; &amp;quot;,&amp;quot;-&amp;quot;,ucwords(strtolower(str_replace(&amp;quot;_&amp;quot;,&amp;quot; &amp;quot;,substr($key,5)))));&lt;br /&gt;
                $out[$key]=$value;&lt;br /&gt;
            }else{&lt;br /&gt;
                $out[$key]=$value;&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
        return $out;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
// Mind that some headers are not included because they&#039;re either useless or unreliable. X-Secondlife-Local-Position&lt;br /&gt;
$headers    = apache_request_headers();&lt;br /&gt;
$objectgrid = $headers[&amp;quot;X-Secondlife-Shard&amp;quot;];&lt;br /&gt;
$objectname = $headers[&amp;quot;X-Secondlife-Object-Name&amp;quot;];&lt;br /&gt;
$objectkey  = $headers[&amp;quot;X-Secondlife-Object-Key&amp;quot;];&lt;br /&gt;
$objectpos  = $headers[&amp;quot;X-Secondlife-Local-Position&amp;quot;];&lt;br /&gt;
$ownerkey   = $headers[&amp;quot;X-Secondlife-Owner-Key&amp;quot;];&lt;br /&gt;
$ownername  = $headers[&amp;quot;X-Secondlife-Owner-Name&amp;quot;];&lt;br /&gt;
$regiondata = $headers[&amp;quot;X-Secondlife-Region&amp;quot;];&lt;br /&gt;
$regiontmp  = explode (&amp;quot;(&amp;quot;,$regiondata);            // cut cords off&lt;br /&gt;
$regionname = substr($regiontmp[0],0,-1);           // cut last space from simname&lt;br /&gt;
$regiontmp  = explode (&amp;quot;)&amp;quot;,$regiontmp[1]);&lt;br /&gt;
$regionpos  = $regiontmp[0];&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
// FETCH HEADERS END&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;display:none;&amp;quot;&amp;gt;&amp;lt;source lang=&amp;quot;lsl2&amp;quot;&amp;gt;&amp;lt;/source&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
|helpers&lt;br /&gt;
|also_header&lt;br /&gt;
|also_events={{LSL DefineRow||[[http_response]]}}&lt;br /&gt;
|also_functions={{LSL DefineRow||[[llEscapeURL]]}}&lt;br /&gt;
{{LSL DefineRow||[[llHTTPResponse]]}}&lt;br /&gt;
{{LSL DefineRow||[[llUnescapeURL]]}}&lt;br /&gt;
|also_articles={{LSL DefineRow||[[Simulator IP Addresses]]}}&lt;br /&gt;
|also_footer&lt;br /&gt;
|notes=If for some reason while using the function [[llHTTPRequest]] or the event [[http_response]] you are unable to parse a known good RSS feed or some other form of web contents, you will need to work around it outside of SecondLife. This is unlikely to change in the near future since checking the headers requires more overhead at the simulator level.&lt;br /&gt;
&lt;br /&gt;
You may find that some web servers return either a null or a nonsensical result when [[llHTTPRequest]] is used, even though the same URL in a PC web browser returns the expected result. This may be due to the fact that the [[llHTTPRequest]] User Agent string is not recognised by some web servers as it does not contain &amp;quot;Mozilla&amp;quot;, which would identify it as a web browser instead of, for example, a Shoutcast or an RSS client. A workaround is to append &amp;quot; HTTP/1.0\nUser-Agent: LSL Script (Mozilla Compatible)\n\n&amp;quot; or similar to the URL string, which will kludge the HTTP request to look like it originates from a web browser. This is also true when the PHP relays on $_COOKIE. Neither can the function [[llHTTPRequest]] set a cookie nor can the event [[http_request]] retrieve them.&lt;br /&gt;
&lt;br /&gt;
CGI environments may place the headers into variables by capitalizing the entire name, replacing dashes with underscores, and prefixing the name with &amp;quot;HTTP_&amp;quot;, e.g. &amp;quot;HTTP_X_SECONDLIFE_OBJECT_NAME&amp;quot;. PHP $_SERVER variables do this as well.&lt;br /&gt;
&lt;br /&gt;
Apache can include the headers in its logs, using the CustomLog and LogFormat directives.  See [http://httpd.apache.org/docs/2.0/mod/mod_log_config.html#formats the docs] for details on the syntax.&lt;br /&gt;
&lt;br /&gt;
|mode&lt;br /&gt;
|deprecated&lt;br /&gt;
|permission&lt;br /&gt;
|cat1=HTTP&lt;br /&gt;
|cat2=XML-RPC&lt;br /&gt;
|cat3=Communications&lt;br /&gt;
|cat4=HTTP/Client&lt;br /&gt;
}}&lt;/div&gt;</summary>
		<author><name>RenateIsabella Resident</name></author>
	</entry>
</feed>