public async Task EditSmartphone(SmartPhone s) { var httpclient = new HttpClient(); //var Smartphone_json = JsonConvert.SerializeObjectAsync(s); HttpContent httpcontent = new StringContent(JsonConvert.SerializeObject(s)); httpcontent.Headers.ContentType = new MediaTypeHeaderValue("application/json"); httpclient.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json")); var response = await httpclient.PutAsync(new Uri(Base_Url+s.Id), httpcontent); }
/// <summary> /// Invoked when this page is about to be displayed in a Frame. /// </summary> /// <param name="e">Event data that describes how this page was reached. /// This parameter is typically used to configure the page.</param> protected override void OnNavigatedTo(NavigationEventArgs e) { this.DataContext = App.Ds; Current_Item = App.Ds.GetItem(e.Parameter.ToString()); }
public async Task DeleteSmartphone(SmartPhone s) { var httpclient = new HttpClient(); var reponse = await httpclient.DeleteAsync(Base_Url + s.Id); }