Ejemplo n.º 1
0
        public async Task <ObjectResult> FindByColor([FromBody] FindUser item)
        {
            string link = commands.WallpaperFindColor(item);

            using var client = new HttpClient();
            var content = await client.GetStringAsync(link); //item1 - ссылка

            WallhavenResponse wallhavenResponse = JsonConvert.DeserializeObject <WallhavenResponse>(content);

            return(new ObjectResult(wallhavenResponse));
        }
Ejemplo n.º 2
0
        public async Task <ObjectResult> FindCategory([FromBody] FindUser item)
        {
            string link = commands.FindByCategory(item);

            using var client = new HttpClient();

            var content = await client.GetStringAsync(link);

            WallhavenResponse wallhavenResponse = JsonConvert.DeserializeObject <WallhavenResponse>(content);

            wallhavenResponse.id = item.id;
            return(new ObjectResult(wallhavenResponse));
        }