private async Task SendItemAsync(SimpleItem item) { var url = "http://happyhappa-uh.azurewebsites.net/api/item/"; var restManager = new RestManagerBase(); var result = await restManager.PutWithJsonPayload(url, item); if (result.StatusCode == System.Net.HttpStatusCode.OK) { this.LastSavedItem = item; } }
public async Task <RestResponse> TryRegisterDevice() { var restManager = new RestManagerBase(); var deviceInformation = new EasClientDeviceInformation(); var req = new { DeviceAddress = deviceInformation.Id.ToString() }; var registrationResult = await restManager.PostWithJsonPayload("http://happyhappa-uh.azurewebsites.net/api/fridge/", req); if (registrationResult.StatusCode != System.Net.HttpStatusCode.OK) { this.LoginMessage = "Unable to reach service"; } return(registrationResult); }
private async Task SendItemDeletionAsync(SimpleItem item) { var url = "http://happyhappa-uh.azurewebsites.net/api/item/"; var restManager = new RestManagerBase(); var result = await restManager.DeleteWithJsonPayload(url, item); }