Difference between revisions of "LlSetContentType"

From Second Life Wiki
Jump to: navigation, search
m (signature)
(Clarified requirements for when this function has an effect (in response to SCR-394))
Line 30: Line 30:
 
|spec
 
|spec
 
|caveats=
 
|caveats=
* This setting will be ignored if...
+
* This setting will be ignored unless all of these conditions are met:
*# the web browser is not the Second Life client
+
*# the web browser is the Second Life client
*# the user (logged into the SL client viewing the page) is not the owner of the object.
+
*# the user (logged into the SL client viewing the page) is the owner of the object.
 +
*# the user (logged into the SL client viewing the page) is connected to the region the object is located in
 
* Not compatible with group owned objects.
 
* Not compatible with group owned objects.
 
|examples
 
|examples

Revision as of 11:07, 20 August 2012

Summary

Function: llSetContentType( key request_id, integer content_type );

Set the Internet media type of an LSL HTTP server response.[1]

• key request_id a valid http_request() key
• integer content_type Media type to use with any following llHTTPResponse(request_id, ...)
content_type Content-Type
CONTENT_TYPE_TEXT 0x0 text/plain
CONTENT_TYPE_HTML 0x1 text/html

Caveats

  • This setting will be ignored unless all of these conditions are met:
    1. the web browser is the Second Life client
    2. the user (logged into the SL client viewing the page) is the owner of the object.
    3. the user (logged into the SL client viewing the page) is connected to the region the object is located in
  • Not compatible with group owned objects.
All Issues ~ Search JIRA for related Bugs

Examples

Notes

  • A workaround for displaying html to non-owners inworld can be found here.

See Also

Events

•  http_request

Functions

•  llHTTPResponse

Articles

•  LSL HTTP server

Deep Notes

History

  • Released August 16, 2011.
Search JIRA for related Issues

Footnotes

  1. ^ This function sets the "Content-Type" header in any subsequent llHTTPResponse responses.

Signature

function void llSetContentType( key request_id, integer content_type );
integer CONTENT_TYPE_TEXT = 0x0;//text/plain
integer CONTENT_TYPE_HTML = 0x1;//text/html

Comments

The client and owner limitations are most likely to remove the possibility of running a website from a prim.