i tried this code but wont work idk why am i doing something wrong? i pasted my key without any error.. ( i ofc gave perms to internet) it says error, not any syntax error
function publishToPastebin(data, dev_key)
local url = "https://pastebin.com/api/api_post.php"
local body = "api_dev_key=" .. dev_key .. "&api_option=paste&api_paste_private=1&api_paste_name=My Private Paste&api_paste_code=" .. data
local headers = { ["Content-Type"] = "application/x-www-form-urlencoded" }
local response = gg.makeRequest(url, { method = "POST", body = body, headers = headers })
if response and response.status == 200 then
local paste_url = response.body
gg.alert("Your pastebin has benn published URL: " .. paste_url)
else
gg.alert("Error.")
end
end
local dev_key = "MY API KEY"
-- data to publish
local data = "test"
-- Publish Pastebin
publishToPastebin(data, dev_key)