public Uri PostProduct(Product product) { HttpResponseMessage response = client.PostAsJsonAsync("api/AWProducts", product).Result; if (!response.IsSuccessStatusCode) { Debug.WriteLine("{0} ({1})", (int)response.StatusCode, response.ReasonPhrase); return null; } return response.Headers.Location; }
public void PutProduct(int id, Product product) { HttpResponseMessage response = client.PutAsJsonAsync("api/AWProducts/" + id, product).Result; Debug.WriteLine("{0} ({1})", (int)response.StatusCode, response.ReasonPhrase); }