Need help with HttpService

So, I wanted a discord webhook to send a message. The problem is, It says HttpError: 400 Bad requests. So, I realize there is a mistake I made in JSON. So, I fix it. But, it still didn’t work. Still says 400.

Here is my code

local image = game.Players:GetUserThumbnailAsync(player.UserId, Enum.ThumbnailType.HeadShot, Enum.ThumbnailSize.Size100x100)
	
	local data = {
		["embeds"] = {
			["author"] = {
				["name"] = player.DisplayName.." (@"..player.Name..")",
				["icon_url"] = image,
			},
			["description"] = content,
			["footer"] = {
				["text"] = "Posted by UserId: "..player.UserId
			},
		}
	}
	
	local finalData = HttpService:JSONEncode(data)
	
	
	HttpService:PostAsync(webhook, finalData)

HttpError: 400 Bad requests means you’re using incorrect formatting or have missing information/data, check documentation of the api you’re trying to use, here’s the one for discord:

local image = game.Players:GetUserThumbnailAsync(player.UserId, Enum.ThumbnailType.HeadShot, Enum.ThumbnailSize.Size100x100)
	
	local data = {
		["embeds"] = {{ -- keep in mind you can post multiple embeds
			["author"] = {
				["name"] = player.DisplayName.." (@"..player.Name..")",
				-- no, it does not return an url ["icon_url"] = image,
			},
			["description"] = content,
			["footer"] = {
				["text"] = "Posted by UserId: "..player.UserId
			},
		}}
	}
	
	local finalData = HttpService:JSONEncode(data)
	
	
	HttpService:PostAsync(webhook, finalData)
1 Like

I have already tried it.

I know. I use that docs

did you really tried it? try copy pasting my code, it works for me

GetUserThumbnailAsync is basically returns a url. Not http tough, but rbxthumb. But, still it is a url.

if i’m not wrong, you can only use http(s) urls

You are right, This is a docs