Ejemplo n.º 1
0
        public static string RequestUri(ApiEndPointType endpoint, string host)
        {
            string queryString = endpoint.GetQueryStringParameters(host, ApiKey, OutputFormat);

            string requestUri = string.Empty;

            if (endpoint == ApiEndPointType.GeoIpLocation)
            {
                requestUri = $"{host}{queryString}";
            }
            else if (endpoint == ApiEndPointType.RdapLookup)
            {
                requestUri = $"{endpoint.GetEnumValue().GetValue()}{queryString}";
            }
            else if (endpoint == ApiEndPointType.DomainAvailability)
            {
                requestUri = $"{queryString}";
            }
            else
            {
                requestUri = $"{endpoint.GetEnumValue().GetValue().ToLowerInvariant()}/{queryString}";
            }

            return(requestUri);
        }
Ejemplo n.º 2
0
        public static string RapidApiRequestUri(ApiSettingsType setting, ApiEndPointType endpoint, string host)
        {
            string baseUri    = RapidApiBaseUri(setting, endpoint);
            string requestUri = string.Empty;

            if (setting == ApiSettingsType.GeoLocationSettings)
            {
                requestUri = string.Concat(baseUri, host, endpoint.GetQueryStringParameters(host, RapidApiToken(setting), RapidApiResponseFormat));
            }
            else
            {
                requestUri = string.Concat(baseUri, endpoint.GetQueryStringParameters(host, RapidApiToken(setting), RapidApiResponseFormat));
            }

            return(requestUri);
        }