Example #1
0
        public BingResponseDto SearchByExpression(string searchTerm)
        {
            _handler.AddHeader(_subscriptionKey);

            var query = $"{_baseAddress}search?q={searchTerm}&customconfig={_customConfigId}&mkt=en-US";

            System.Threading.Thread.Sleep(1000);

            var response = _handler.GetAsync(query).Result;

            var content = response.Content.ReadAsStringAsync().Result;

            var result = JsonConvert.DeserializeObject <BingResponseDto>(content);

            return(result);
        }