Talk:LlHTTPRequest

From Second Life Wiki
Jump to navigation Jump to search

The following headers will be present, usable by scripts running on the HTTP server if the scripting language allows you to access the headers.

Header Description Example data
HTTP_X_SECONDLIFE_SHARD The environment the object is in. "Production" is the main grid. Production
HTTP_X_SECONDLIFE_OBJECT_NAME The name of the object containing the script Object
HTTP_X_SECONDLIFE_OBJECT_KEY The key of the object containing the script 01234567-89ab-cdef-0123456789abcdef0
HTTP_X_SECONDLIFE_REGION The name of the region the object is in, along with two number (coordinates of the sim?) Jin Ho (264448, 233984)
HTTP_X_SECONDLIFE_LOCAL_POSITION The position of the object within the region (173.009827, 75.551231, 60.950001)
HTTP_X_SECONDLIFE_LOCAL_ROTATION The rotation of the object containing the script 0.000000, 0.000000, 0.000000, 1.000000
HTTP_X_SECONDLIFE_LOCAL_VELOCITY The velocity of the object 0.000000, 0.000000, 0.000000
HTTP_X_SECONDLIFE_OWNER_NAME Name of the owner of the object Zeb Wyler
HTTP_X_SECONDLIFE_OWNER_KEY Key of the owner of the object 01234567-89ab-cdef-0123456789abcdef0

An PHP example on how to check to see if the call came from the main grid:

<?php
    if ($_SERVER["HTTP_X_SECONDLIFE_SHARD"] == "Production") {
        echo 'You are using the main grid';
    } else {
        echo 'You are not using the main grid';
    }
?>