예제 #1
0
        public virtual async Task <ImageInsightResponse> GetImageInsightsAsync(
            string query                     = "",
            int height                       = 0,
            int width                        = 0,
            int count                        = 0,
            int offset                       = 0,
            string languageCode              = "",
            AspectOptions aspect             = AspectOptions.All,
            ColorOptions color               = ColorOptions.All,
            FreshnessOptions freshness       = FreshnessOptions.All,
            ImageContentOptions imageContent = ImageContentOptions.All,
            ImageTypeOptions imageType       = ImageTypeOptions.All,
            LicenseOptions license           = LicenseOptions.All,
            SizeOptions size                 = SizeOptions.All,
            SafeSearchOptions safeSearch     = SafeSearchOptions.Off,
            List <ModulesRequestedOptions> modulesRequested = null,
            float cab            = 0f,
            float cal            = 0f,
            float car            = 0f,
            float cat            = 0f,
            int ct               = 0,
            string cc            = "",
            string id            = "",
            string imgUrl        = "",
            string insightsToken = "")
        {
            var url = GetImageInsightUrl(query, height, width, count, offset, languageCode, aspect, color,
                                         freshness, imageContent, imageType, license, size, safeSearch, modulesRequested, cab, cal,
                                         car, cat, ct, cc, id, imgUrl, insightsToken);

            var response = await RepositoryClient.SendPostMultiPartAsync(ApiKeys.BingSearch, url, "{}");

            return(JsonConvert.DeserializeObject <ImageInsightResponse>(response));
        }