コード例 #1
0
 public async Task<PostsResponse> UpdatePostAsync(string id, NewPost post)
 {
     var result = await _webManager.PutData(new Uri(string.Format(Endpoints.UpdateDeletePost, id)), null, new StringContent(JsonConvert.SerializeObject(post), Encoding.UTF8, "application/json"));
     return JsonConvert.DeserializeObject<PostsResponse>(result.ResultJson);
 }
コード例 #2
0
 public async Task<PostsResponse> CreateNewPostAsync(NewPost post)
 {
     var result = await _webManager.PostData(new Uri(Endpoints.CreateByte), null, new StringContent(JsonConvert.SerializeObject(post), Encoding.UTF8, "application/json"));
     return JsonConvert.DeserializeObject<PostsResponse>(result.ResultJson);
 }