Sending JSON to Discord API
Hoping someone will have hit this issue before, or have an idea how to fix.

I have this code:

string discordWebhook = "---WEBHOOK URL HERE---";
string discordMessage = "{\"content:\": \"**" + playerName + "** did something on **" + serverName + "**.\"}";


webrequest.Enqueue(discordWebhook, discordMessage, (code, response) => CallHelpCallback(code, response), this, RequestMethod.POST);

But I'm getting an error back from the Discord API saying the 'message' is empty:

{"code": 50006, "message": "Cannot send an empty message"}

Anyone have any idea how to fix? I suspect it is an issue with Content-Type... not certain though.


Thanks in advance.
Your content field is called content: in discordMessage
"{\"content:\":
should be:
"{\"content\":
Well spotted...! That fixed it immediately :D