im trying to register my Mac APP to my Azure Notification Hub. I already can create a registration ID and now I just need to register. https://msdn.microsoft.com/de-de/library/azure/dn223265.aspx
I get always a 400 Bad Request response. Not sure where the problem is.
this is the code I'm using:
string payload = @"<?xml version=""1.0"" encoding=""utf-8""?><entry xmlns=""http://www.w3.org/2005/Atom""><content type=""application/xml""><AppleRegistrationDescription xmlns:i=""http://www.w3.org/2001/XMLSchema-instance"" xmlns=""http://schemas.microsoft.com/netservices/2010/10/servicebus/connect""><Tags>myTag</Tags><DeviceToken>ABCDEFGHIJKLMNOPQRSTUVWXYZ</DeviceToken></AppleRegistrationDescription></content></entry>";
payload = payload.Replace("ABCDEFGHIJKLMNOPQRSTUVWXYZ", deviceToken);
var client = new HttpClient();
client.DefaultRequestHeaders.Accept.Clear();
client.DefaultRequestHeaders.Add("Authorization", SasToken);
client.DefaultRequestHeaders.Add("Accept", "application/atom+xml");
client.DefaultRequestHeaders.Add("x-ms-version", "2015-01");
HttpResponseMessage response = await client.PostAsync("https://" + HUB_NotificationHubNameSapce + ".servicebus.windows.net/" + HUB_NotificationHubPath + "/registrations/?api-version=2015-01", new StringContent(payload, Encoding.UTF8, "application/atom+xml"));
i don't believe it is the payload because I tried different ones, I think I make something wrong with the HttpClient.