diff --git a/Docs/Luadoc/LuaDocumentation.xml b/Docs/Luadoc/LuaDocumentation.xml
index 8eb642c8d7..c5268d92e9 100644
--- a/Docs/Luadoc/LuaDocumentation.xml
+++ b/Docs/Luadoc/LuaDocumentation.xml
@@ -3583,20 +3583,20 @@ end
NETWORK:HttpRequest{
url="https://api.example.com",
- method="GET", -- default: "GET"
- body="", -- default: ""
- multipartBoundary="", -- default: ""
- headers={ -- default: {}
+ method="GET", -- default: "GET"
+ body="", -- default: ""
+ multipartBoundary="", -- default: ""
+ headers={ -- default: {}
["Accept-Language"]="en-US",
["Cookie"]="sessionId=42",
},
- connectTimeout=3, -- default: 60
- transferTimeout=10, -- default: 1800
- downloadFile="", -- default: no download file
- onProgress=function(currentBytes, totalBytes) -- default: no callback
+ connectTimeout=3, -- default: 60
+ transferTimeout=10, -- default: 1800
+ downloadFile="", -- default: no download file
+ onProgress=function(currentBytes, totalBytes) -- default: no callback
...
end,
- onResponse=function(response) -- default: no callback
+ onResponse=function(response) -- default: no callback
...
end,
}
@@ -3627,6 +3627,63 @@ NETWORK:HttpRequest{
The file is available in the onResponse callback where it can be unzipped/copied to another location using FILEMAN:Unzip()/FILEMAN:Copy() respectively.
The file is deleted once the callback returns.
+
+ Open a WebSocket connection.
+ Usage example:
+
+NETWORK:WebSocket{
+ url="wss://api.example.com/chat",
+ headers={ -- default: {}
+ ["Accept-Language"]="en-US",
+ ["Cookie"]="sessionId=42",
+ },
+ handshakeTimeout=3, -- default: 60 seconds
+ pingInterval=10, -- default: disabled
+ automaticReconnect=false, -- default: true
+ onMessage=function(message) -- default: no callback
+ ...
+ end,
+}
+
+ Everything but url is optional.
+ Messages look like this:
+
+-- Data
+{
+ type="WebSocketMessageType_Message",
+ data="some data",
+ binary=false,
+}
+
+-- Open
+{
+ type="WebSocketMessageType_Open",
+ uri="/chat",
+ headers={
+ ["Date"]="Fri, 27 May 2022 18:50:47 GMT",
+ },
+ protocol="",
+}
+
+-- Close
+{
+ type="WebSocketMessageType_Close",
+ reason="Normal closure",
+ remote=false,
+}
+
+-- Error
+{
+ type="WebSocketMessageType_Error",
+ retries=1,
+ waitTime=100,
+ httpStatusCode=404,
+ reason="Expecting status 101 (Switching Protocol), got 404",
+ decompressionError=false,
+
+}
+
+
Returns the URL encoded representation of value.
@@ -6617,6 +6674,16 @@ local bpms_and_times = timing_data:GetBPMsAndTimes(true)
how the song is locked.