Пример #1
0
 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;
 }
Пример #2
0
 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);
 }