Difference between revisions of "LlGetHTTPHeader"

From Second Life Wiki
Jump to navigation Jump to search
m
m
Line 8: Line 8:
|return_text=that is the value for '''header''' for '''request_id'''.
|return_text=that is the value for '''header''' for '''request_id'''.
|spec=
|spec=
;Supported Headers
===Supported Headers===
* "x-script-url": The base url, as originally recieved from llRequestPublicURL
Sample URL: [https://sim3015.aditi.lindenlab.com:12043/cap/a7717681-2c04-e4ac-35e3-1f01c9861322/foo/bar?arg=gra <font color="green">https://sim3015.aditi.lindenlab.com:12043/cap/a7717681-2c04-e4ac-35e3-1f01c9861322</font><font color="blue">/foo/bar</font>?<font color="red">arg=gra</font>]
* "x-path-info": Any trailing path information from the requested url
{{{!}} class="lltable" border="1"
* "x-query-string": Any query arguments, the text past a ? in the url
! header
* "x-remote-ip": IP address of the host that made the request
! description
* "user-agent": The user-agent header as reported by the requester
! example
<!--
{{!}}-
requested url: ''https://sim3015.aditi.lindenlab.com:12043/cap/a7717681-2c04-e4ac-35e3-1f01c9861322/foo/bar?arg=gra''
{{!}} "x-script-url"
x-script-url: ''https://sim3015.aditi.lindenlab.com:12043/cap/a7717681-2c04-e4ac-35e3-1f01c9861322''
{{!}} The base url, as originally received from [[llRequestURL]]/[[llRequestSecureURL]]
x-path-info: ''/foo/bar''
{{!}} <font color="green"><nowiki>https://sim3015.aditi.lindenlab.com:12043/cap/a7717681-2c04-e4ac-35e3-1f01c9861322</nowiki></font>
x-query-string: ''arg=gra''
{{!}}-
-->
{{!}} "x-path-info"
{{!}} Any trailing path information from the requested url
{{!}} <font color="blue">/foo/bar</font>
{{!}}-
{{!}} "x-query-string"
{{!}} Any query arguments, the text past the first "?" in the url
{{!}} <font color="red">arg=gra</font>
{{!}}-
{{!}} "x-remote-ip"
{{!}} IP address of the host that made the request
{{!}}
{{!}}-
{{!}} "user-agent"
{{!}} The user-agent header as reported by the requester
{{!}}
{{!}}}
 
|caveats=* LSL is not a CGI environment
|caveats=* LSL is not a CGI environment
** "Content-Type" is an example of a normal header name, in a CGI environment the name would be "HTTP_CONTENT_TYPE".
** "Content-Type" is an example of a normal header name, in a CGI environment the name would be "HTTP_CONTENT_TYPE".

Revision as of 10:12, 13 July 2009

Summary

Function: string llGetHTTPHeader( key request_id, string header );

Returns a string that is the value for header for request_id.

• key request_id A valid HTTP request key.
• string header Header value name.

Specification

Supported Headers

Sample URL: https://sim3015.aditi.lindenlab.com:12043/cap/a7717681-2c04-e4ac-35e3-1f01c9861322/foo/bar?arg=gra

header description example
"x-script-url" The base url, as originally received from llRequestURL/llRequestSecureURL https://sim3015.aditi.lindenlab.com:12043/cap/a7717681-2c04-e4ac-35e3-1f01c9861322
"x-path-info" Any trailing path information from the requested url /foo/bar
"x-query-string" Any query arguments, the text past the first "?" in the url arg=gra
"x-remote-ip" IP address of the host that made the request
"user-agent" The user-agent header as reported by the requester

Caveats

  • LSL is not a CGI environment
    • "Content-Type" is an example of a normal header name, in a CGI environment the name would be "HTTP_CONTENT_TYPE".
  • This header information is valid for 30 seconds, or until llHTTPResponse() is called.
All Issues ~ Search JIRA for related Bugs

Examples

See Also

Events

•  http_request

Functions

•  llGetFreeURLs
•  llRequestURL
•  llRequestSecureURL
•  llReleaseURL
•  llHTTPResponse

Articles

•  LSL http server
•  "Wikipedia logo"Wikipedia:List of HTTP headers

Deep Notes

History

Search JIRA for related Issues

Signature

function string llGetHTTPHeader( key request_id, string header );