I am trying to design a user feedback system in which users can type in a text box and they could submit their feedback directly to my discord webhook. When I tried it for myself, I keep on getting an HTTP 400 error. CONTEXT: There is a remote event in ReplicatedStorage and a text box and text button in startergui, a localscript in startergui and a script in serverscriptservice. Here is the code:
LocalScript:
FeedbackGUI.Frame.submit.Activated:Connect(function()
local text = PlayerGui.ReportGui.Frame.TextBox.Text
SubmitReport:FireServer(text)
end)
Script:
local HTTPService = game:GetService("HttpService")
local feedback = game.ReplicatedStorage.SubmitReport.OnServerEvent:Connect(function(player, msg)
local name = tostring(player.Name)
tostring(msg)
return name .. " said " .. msg
end)
local Data = {
["content"] = feedback
}
Data = HTTPService:JSONEncode(Data)
HTTPService:PostAsync("URL", Data)
Output:
13:04:48.796 - HTTP 400 (Bad Request)
The discord URL works and the remote event also works. Just the last step doesn’t work, i.e. somewhere within the server-script.