Automatically encode table bodies in http
This commit is contained in:
parent
30d7ab628b
commit
5081d03d82
@ -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={}
|
||||
|
Loading…
Reference in New Issue
Block a user