コード例 #1
0
        public async Task <IActionResult> GetYoutubeCommentsJson(string token, string link)
        {
            if (string.IsNullOrEmpty(link))
            {
                return(BadRequest("Link Empty"));
            }
            try
            {
                var resultJson = await _youtubeService.GetComments(token, link);

                var resultClass = JsonConvert.DeserializeObject(resultJson);
                return(Ok(JsonConvert.SerializeObject(resultClass)));
            }
            catch (HttpRequestException e)
            {
                return(Content("Error processing" + e));
            }
        }