HTTPRequestParam
Constants in the HTTPRequestParam enum.
// RequestHTTP_METHOD, string method // "GET" (default), "POST", "PUT" or "DELETE"HTTP_MIMETYPE, string MIME_type // request body type; default "text/plain;charset=utf-8"HTTP_CUSTOM_HEADER, string name, string value // up to 8 per requestHTTP_ACCEPT, string MIME_type // types for the Accept header; other responses give status 415HTTP_USER_AGENT, string user agent value // appended to the default; no spacesHTTP_PRAGMA_NO_CACHE, integer send_header // default TRUE// ResponseHTTP_BODY_MAXLENGTH, integer length // bytes; default 2048, Mono up to 16384HTTP_EXTENDED_ERROR, integer extended // errors arrive in http_response as RFC 7807 JSON// Security and diagnosticsHTTP_VERIFY_CERT, integer verify // default TRUEHTTP_VERBOSE_THROTTLE, integer noisy // throttle errors on DEBUG_CHANNEL; default TRUE
Constants
Request
| Constant | Type | Value | Description |
|---|---|---|---|
HTTP_METHOD | integer | 0 | Specifies the HTTP method ('GET', 'POST', 'PUT', or 'DELETE') for the request. |
HTTP_MIMETYPE | integer | 1 | Specifies the request Content-Type MIME type. Text types should define a charset (e.g., 'text/plain;charset=utf-8'). Use 'application/x-www-form-urlencoded' to emulate HTML forms. |
HTTP_CUSTOM_HEADER | integer | 5 | Adds custom HTTP headers to the request (up to 8 per request). At the SLua level, provide a string-keyed table mapping header names to values; the serializer emits one HTTP_CUSTOM_HEADER/key/value triple per entry. Some default or sensitive headers are blocked for security reasons. |
HTTP_ACCEPT | integer | 8 | Used with llHTTPRequest to override the default Accept header with custom MIME types (such as application/json, text/html, etc.). Responses with unlisted content types will return status 415. |
HTTP_USER_AGENT | integer | 7 | Appends a custom string to the default LSL User-Agent header value. Must follow HTTP standard syntax (e.g., 'My-Script-Name/1.0'). Spaces are not allowed and will cause a script error; use hyphens instead. |
HTTP_PRAGMA_NO_CACHE | integer | 6 | Controls whether the 'Pragma: no-cache' header is sent with the HTTP request. When SendHeader is TRUE (default), the header is sent; when FALSE, it is omitted. |
Response
| Constant | Type | Value | Description |
|---|---|---|---|
HTTP_BODY_MAXLENGTH | integer | 2 | Sets the maximum (UTF-8 encoded) byte length of the HTTP response body. The maximum limit depends on the VM being used (Mono Max: 16384 bytes, LSO Max: 4096 bytes). |
HTTP_EXTENDED_ERROR | integer | 9 | If set to TRUE, llHTTPRequest always returns a key. If an error occurs during the request, detailed error information (delivered in an RFC 7807 JSON block) is reported through the http_response event using that key. |
Security and diagnostics
| Constant | Type | Value | Description |
|---|---|---|---|
HTTP_VERIFY_CERT | integer | 3 | If set to TRUE, the server's SSL certificate must be verifiable using a standard certificate authority when making HTTPS requests. If FALSE, any SSL certificate is accepted. |
HTTP_VERBOSE_THROTTLE | integer | 4 | If set to TRUE, shouts error messages to DEBUG_CHANNEL if the outgoing request rate exceeds the server limit. If FALSE, these error messages are suppressed. |
Used by
llHTTPRequestfunctionSends an HTTP request to the specified url containing body and configured via parameters. Raises an http_response event and returns a key query handle identifying the request.