Difference between revisions of "Template:LSL Constants HTTP"

From Second Life Wiki
Jump to navigation Jump to search
m (Clarified that HTTP_BODY_MAXLENGTH affects the return body as received by http_response())
m (Added acceptable MIME TYPES from reading the headers of an HTTP Request.)
Line 34: Line 34:
{{!}} <nowiki>[</nowiki>[[string]]&nbsp;{{LSL Param|MIME_type}}<nowiki>]</nowiki>
{{!}} <nowiki>[</nowiki>[[string]]&nbsp;{{LSL Param|MIME_type}}<nowiki>]</nowiki>
{{!}} <nowiki>[</nowiki>"text/plain;charset=utf-8"<nowiki>]</nowiki>
{{!}} <nowiki>[</nowiki>"text/plain;charset=utf-8"<nowiki>]</nowiki>
{{!}} text/* MIME types should specify a charset. To emulate HTML forms use application/x-www-form-urlencoded. This allows you to set the body to a properly escaped ([[llEscapeURL]]) sequence of &lt;name,value&gt; pairs in the form var=value&amp;var2=value2 and have them automatically parsed by web frameworks
{{!}} text/* MIME types should specify a charset. To emulate HTML forms use application/x-www-form-urlencoded. This allows you to set the body to a properly escaped ([[llEscapeURL]]) sequence of &lt;name,value&gt; pairs in the form var=value&amp;var2=value2 and have them automatically parsed by web frameworks.
;Accepted MIME types are:
: <nowiki>"text/application/xhtml+xml"</nowiki>
: <nowiki>"text/application/atom+xml"</nowiki>
: <nowiki>"text/application/json"</nowiki>
: <nowiki>"text/application/xml"</nowiki>
: <nowiki>"text/application/llsd+xml"</nowiki>
: <nowiki>"text/application/x-javascript"</nowiki>
: <nowiki>"text/application/javascript"</nowiki>
: <nowiki>"text/application/x-www-form-urlencoded"</nowiki>
: <nowiki>"text/application/rss+xml"</nowiki>                                         
{{!}}-
{{!}}-
{{!}} {{LSL Const|HTTP_BODY_MAXLENGTH|integer|2}}
{{!}} {{LSL Const|HTTP_BODY_MAXLENGTH|integer|2}}

Revision as of 19:53, 12 June 2016

Flag Parameter(s) Default Parameter Value(s) Description
HTTP_METHOD 0 [string method] ["GET"] "GET", "POST", "PUT" and "DELETE"
HTTP_MIMETYPE 1 [string MIME_type] ["text/plain;charset=utf-8"] text/* MIME types should specify a charset. To emulate HTML forms use application/x-www-form-urlencoded. This allows you to set the body to a properly escaped (llEscapeURL) sequence of <name,value> pairs in the form var=value&var2=value2 and have them automatically parsed by web frameworks.
Accepted MIME types are
"text/application/xhtml+xml"
"text/application/atom+xml"
"text/application/json"
"text/application/xml"
"text/application/llsd+xml"
"text/application/x-javascript"
"text/application/javascript"
"text/application/x-www-form-urlencoded"
"text/application/rss+xml"
HTTP_BODY_MAXLENGTH 2 [integer length] [2048] Sets the maximum (UTF-8 encoded) byte length of the HTTP response body. The maximum that can be set depends upon which VM is used.
HTTP_VERIFY_CERT 3 [integer verify] [TRUE] If TRUE, the server SSL certificate must be verifiable using one of the standard certificate authorities[1] when making HTTPS requests. If FALSE, any server SSL certificate will be accepted.
HTTP_VERBOSE_THROTTLE 4 [integer noisy] [TRUE] If TRUE, shout error messages to DEBUG_CHANNEL if the outgoing request rate exceeds the server limit. If FALSE, the error messages are suppressed (llHTTPRequest will still return NULL_KEY).
HTTP_CUSTOM_HEADER 5 [string name, string value] NA Add an extra custom HTTP header to the request. The first string is the name of the parameter to change, e.g. "Pragma", and the second string is the value, e.g. "no-cache". Up to 8 custom headers may be configured per request, and each header's combined name+value length must be no greater than 253 characters. Note that certain headers, such as the default headers, are blocked for security reasons.
HTTP_PRAGMA_NO_CACHE 6 [integer send_header] [TRUE] Sends "Pragma: no-cache" header (TRUE), or does not send a "Pragma" header (FALSE).