Example #1
0
        private async Task <CommentsResult> Read(bool all, int page, CancellationToken token)
        {
            var request = JsonConvert.SerializeObject(RequestComments.Create(long.Parse(article.Id), all, page: page));
            var json    = await reader.Post(
                new Uri("https://api.delfi.lt/comment/v1/graphql"),
                request,
                token,
                webRequest =>
            {
                webRequest.Headers["Origin"]          = "https://www.delfi.lt";
                webRequest.Headers["Accept-Encoding"] = "gzip, deflate, br";
                webRequest.Referer     = article.Url.ToString();
                webRequest.ContentType = "application/json";
            }).ConfigureAwait(false);

            var data = JsonConvert.DeserializeObject <CommentsResult>(json, Converter.Settings);

            return(data);
        }