public BaseServiceRapidapi(IOptionsSnapshot <RapidapiConfiguration> rapidapiConfiguration,
                                   ISendRequest sendRequest)
        {
            _rapidapiConfiguration = rapidapiConfiguration.Value;
            _sendRequest           = sendRequest;

            if (_rapidapiConfiguration != null)
            {
                _client = new RestClient(_rapidapiConfiguration.BaseUrl);
            }
        }
Exemplo n.º 2
0
        public static void AddRapidapiHeaders(this RestRequest request, RapidapiConfiguration configuration)
        {
            if (configuration.Headres == null)
            {
                return;
            }

            foreach (var header in configuration.Headres)
            {
                request.AddHeader(header.Key, header.Value);
            }
        }