Automatically encode table bodies in http

This commit is contained in:
Aidan 2023-03-13 15:55:00 +00:00
parent 30d7ab628b
commit 5081d03d82
Signed by: 9382
GPG Key ID: 9BF9CD918201F681

View File

@ -13,6 +13,7 @@ local STRAFES_NET_RATELIMIMT = {
}
local remaining_timeout = 0
local function request(method,url,headers,body,options)
if type(body)=='table' then body=json.encode(body) end
local headers,body=http.request(method,url,headers,body,options)
local rbody=json.decode(body) or body
local rheaders={}