Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

HTTP 400 (Bad Request) - Discord webhook?

So i tried to make a thing where people can send feedback and stuff.

15:35:22.003 - HTTP 400 (Bad Request)

My current code is:

local HTTPService = game:GetService("HttpService")
local url = "private so im not showing"
local debounce = true
script.Parent.MouseButton1Click:Connect(function()
	if debounce then
		debounce = false
		local Data = {
			["username"] = script.Parent.Parent.Parent.Parent.Parent.Name,
			["content"] = script.Parent.Parent.TextBox.Text
		}
		Data = HTTPService:JSONEncode(Data)
		HTTPService:PostAsync(url, Data)
		wait(540)
		debounce = true
	end
end)

1 comment

1

is httpservice enabled??

1 answer

Try This:

local HTTPService = game:GetService("HttpService")
local url = "private so im not showing"
local debounce = true
script.Parent.MouseButton1Click:Connect(function()
    if debounce then
        debounce = false
        local Data = {
            ["username"] = script.Parent.Parent.Parent.Parent.Parent.Name,
            ["content"] = script.Parent.Parent.TextBox.Text
        }
        Data = HTTPService:JSONEncode(Data)
        local s, e = pcall(function()
               HTTPService:PostAsync(url, Data)
        end)
        if not s then print(e) end
        wait(540)
        debounce = true
    end
end)

1 comment

0

that just prints out: HTTP 400 (Bad Request) but its not red text

This discussion is preserved as it was. New answers, comments, and votes are closed.