Problem with HttpService

i am trying to send messge though discord web hook but it giving me " HTTP 400 (Bad Request) "
i dont really know why if anyone could help i would be thankful
the code

local HtppRequest = game:GetService("HttpService")

local WebHook = "web hook <:"
local data = {

["embeds"] =  {
	{
		["title"] = "",
		["description"] = "",

		["color"] = 5763719,
		["fields"] = {
			{
				["name"] = "الاسم",
				["value"] = "d",
				["inline"] = true
			},
			{
				["name"] = "موجود",
				["value"] = "",
				["inline"]= true
			}

		},
		["footer"] = {
			["text"]= "#PlayerName"
		},
		["timestamp"] = os.date("%Y/%m/%d")
	}
}}

local SendUserName = HtppRequest:PostAsync(WebHook,HtppRequest:JSONEncode(data))


Pretty sure discord banned webhooks from roblox. Discord webhook not working in the real game - #2 by darkvrn

in real game? what u mean like when i play it on roblox not in studio?

cuz i have anthor webhook message that send to discord normally nothing wrong with it just with the embed

Is that using a proxy or just testing in studio? because sometimes it will work in studio then give an error when you test in a real server.

		local SendUserName = HtppRequest:PostAsync(WebHook,HtppRequest:JSONEncode({["content"] = "اصبر 30 ثانيه بالله" }))

this message is sending normally in studio but the embed not i will try to test the game in roblox not in the studio thanks

1 Like

This is because when testing in studio the requests are made from your own IP to discord, not the actual Roblox server. Discord has blacklisted Roblox servers specifically, not your own personal IP.

This also means that plugins or in-game server scripts you run during studio testing can IP grab you.

1 Like

but tho it send the message i just tested in roblox not in studio , thanks i didnt know that in studio they are using ur ip, my script worked fine in roblox server and it send the webhook successfully but it have something with the embed i think i might didnt write it right ,

The Status Code 400 means Bad Request. Did you check your headers? Did you encode the data into JSON before sending the POST request? HTTP is very strict about the headers. One single error is all it takes to unleash a 400 error. - Riley the IT whiz