Advertisement
Guest User

WebApiHiba

a guest
Mar 29th, 2020
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.54 KB | None | 0 0
  1. try
  2.                 {
  3.                     var serializedItem = JsonConvert.SerializeObject(fooModel);
  4.                     var content = new StringContent(serializedItem, Encoding.UTF8, "application/json");
  5.                     var response = await _client.PostAsync($"{App.BackendUrl}/api/foo/addfoo", content);
  6.  
  7.                     return response.IsSuccessStatusCode;
  8.                 }
  9.                 catch (Exception ex)
  10.                 {
  11.                     Console.WriteLine(ex);
  12.                     // TODO: log exception
  13.                 }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement