Difference between revisions of "LlSetContentType"

From Second Life Wiki
Jump to: navigation, search
m (+note: workaround)
m (signature)
Line 1: Line 1:
 
{{LSL_Function
 
{{LSL_Function
|inject-1=
+
|signature=
|mode=release
+
{{LSL Const/Signature|CONTENT_TYPE_TEXT|integer|hex=0x0|c=text/plain}}
 +
{{LSL Const/Signature|CONTENT_TYPE_HTML|integer|hex=0x1|c=text/html}}
 
|func=llSetContentType
 
|func=llSetContentType
 
|func_id=?
 
|func_id=?

Revision as of 13:40, 11 January 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 if...
    1. the web browser is not the Second Life client
    2. the user (logged into the SL client viewing the page) is not the owner of the object.
  • 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.