Пример #1
0
 public Device AddDevice(Device device)
 {
     var url = String.Format ("http://{0}:{1}/v1/users/{2}/devices/{3}", Host, Port, device.User, device.DeviceToken);
     var serializer = new JavaScriptSerializer();
     var body = serializer.Serialize(device);
     var reply = m_client.UploadData(url, "PUT", Encoding.UTF8.GetBytes (body));
     var ret = serializer.Deserialize<Device>(Encoding.UTF8.GetString(reply));
     return ret;
 }
Пример #2
0
 public void RemoveDevice(Device device)
 {
     var url = String.Format ("http://{0}:{1}/v1/users/{2}/devices/{3}", Host, Port, device.User, device.DeviceToken);
     m_client.UploadData(url, "DELETE", null);
 }