My best guess was that it has something to do with the charset.
I included the chartset in the header but I still get the same error.
Here is my code:
code
private string EnviarNotificacao(string deviceId,string mensagem) {
PushNotification notification = new PushNotification();
notification.payload = new Payload { badge = 1, message = mensagem };
notification.status = "sent"
notification.filter = new Filter { deviceID = deviceId };
Code: Select all
string jsonString = JsonConvert.SerializeObject(notification);
string url = "https://api.appery.io/rest/push/msg"
using (WebClient client = new WebClient())
{
client.Headers.Add("X-Appery-Push-API-Key", pushApkiKey);
client.Headers[HttpRequestHeader.ContentType] = "application/json"
try
{
client.UploadString(url, "POST", jsonString);
}
catch (Exception)
{
MessageBox.Show("Erro ao enviar mensagem");
}
}
return jsonString;
}
/code