Difference between revisions of "Talk:LlHTTPRequest"

From Second Life Wiki
Jump to navigation Jump to search
 
Line 1: Line 1:
== Headers ==
The following headers will be present, usable by scripts running on the HTTP server if the scripting language allows you to access the headers.
The following headers will be present, usable by scripts running on the HTTP server if the scripting language allows you to access the headers.
 
{|{{Prettytable}}
'''HTTP_X_SECONDLIFE_SHARD'''<br>
! Header
The environment the object is in. "Production" is the main grid, don't know the value for the beta grid.<br>
! Description
Eg: Production
! Example data
 
|-
'''HTTP_X_SECONDLIFE_OBJECT_NAME'''<br>
| HTTP_X_SECONDLIFE_SHARD
The name of the object the script is in<br>
| The environment the object is in. "Production" is the main grid.
Eg: Object
| Production
 
|-
'''HTTP_X_SECONDLIFE_OBJECT_KEY'''<br>
| HTTP_X_SECONDLIFE_OBJECT_NAME
The key of the object the script is in<br>
| The name of the object containing the script
Eg: 01234567-89ab-cdef-0123456789abcdef0
| Object
 
|-
'''HTTP_X_SECONDLIFE_REGION''' <br>
| HTTP_X_SECONDLIFE_OBJECT_KEY
The name of the region the object is at, along with two number (coordinates of the sim?)<br>
| The key of the object containing the script
Eg: Jin Ho (264448, 233984)
| 01234567-89ab-cdef-0123456789abcdef0
 
|-
'''HTTP_X_SECONDLIFE_LOCAL_POSITION''' <br>
| HTTP_X_SECONDLIFE_REGION
The position the object has in a region <br>
| The name of the region the object is in, along with two number (coordinates of the sim?)
Eg: (173.009827, 75.551231, 60.950001)
| Jin Ho (264448, 233984)
 
|-
'''HTTP_X_SECONDLIFE_LOCAL_ROTATION'''<br>
| HTTP_X_SECONDLIFE_LOCAL_POSITION
The rotation of the object<br>
| The position of the object within the region
Eg: 0.000000, 0.000000, 0.000000, 1.000000
| (173.009827, 75.551231, 60.950001)
 
|-
'''HTTP_X_SECONDLIFE_LOCAL_VELOCITY'''<br>
| HTTP_X_SECONDLIFE_LOCAL_ROTATION
The velocity of the object<br>
| The rotation of the object containing the script
Eg: 0.000000, 0.000000, 0.000000
| 0.000000, 0.000000, 0.000000, 1.000000
 
|-
'''HTTP_X_SECONDLIFE_OWNER_NAME'''<br>
| HTTP_X_SECONDLIFE_LOCAL_VELOCITY
Name of the owner of the object <br>
| The velocity of the object
Eg: Zeb Wyler
| 0.000000, 0.000000, 0.000000
 
|-
'''HTTP_X_SECONDLIFE_OWNER_KEY'''<br>
| HTTP_X_SECONDLIFE_OWNER_NAME
Key of the owner of the object<br>
| Name of the owner of the object
Eg: 01234567-89ab-cdef-0123456789abcdef0
| 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:
An PHP example on how to check to see if the call came from the main grid:

Revision as of 06:54, 9 May 2007

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';
    }
?>