public async Task <PostEntityModel> AddPost(PostEntityModel post) { string url = _postsUrlBuilder.Build(); var request = _postRequestBuilder .WithPostData(post) .Build(); var response = await _httpClient.PostAsync(url, new StringContent(request)); response.EnsureSuccessStatusCode(); return(await response.Content.ReadFromJsonAsync <PostEntityModel>()); }
public PostRequestBuilder WithPostData(PostEntityModel post) { _post = post; return(this); }