From 5081d03d8224c01df5f3c939f4e9db12afe8f219 Mon Sep 17 00:00:00 2001 From: 9382 Date: Mon, 13 Mar 2023 15:55:00 +0000 Subject: [PATCH] Automatically encode table bodies in http --- src/modules/http.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/src/modules/http.lua b/src/modules/http.lua index 63efac6..3b1d753 100644 --- a/src/modules/http.lua +++ b/src/modules/http.lua @@ -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={}