Example #1
0
        public async Task <AuthenticationDto> Authenticate(UserDto userDto)
        {
            var requestMessage = _apiClient.CreatePostRequest($"{_appSettings.AdminApiUrl}{BasePath}/Authenticate", userDto);
            var response       = await _apiClient.SendAsync(requestMessage);

            string responseBody = await response.Content.ReadAsStringAsync();

            var authenticationDto = JsonConvert.DeserializeObject <AuthenticationDto>(responseBody);

            return(authenticationDto);
        }
Example #2
0
        public async Task AddComment(BlogPostCommentDto blogPostCommentDto)
        {
            var requestMessage = _apiClient.CreatePostRequest($"{_appSettings.BlogApiUrl}{BasePath}/AddComment", blogPostCommentDto);
            var response       = await _apiClient.SendAsync(requestMessage);

            string responseBody = await response.Content.ReadAsStringAsync();
        }