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); }
public static string RapidApiBaseUri(ApiSettingsType setting, ApiEndPointType endpoint) { if (setting == ApiSettingsType.GeoLocationSettings) { return(string.Concat("https://", RapidHeaderHostParameter(setting), "/")); } else { return(string.Concat("https://", RapidHeaderHostParameter(setting), "/", endpoint.GetEnumValue().GetValue().ToLowerInvariant(), "/")); } }