예제 #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);
 }