Beispiel #1
0
 public RoamingValidationServiceClient(string applicationKey, DeploymentTargets target)
 {
     Url     = GetUrl(applicationKey, target);
     _client = new HttpClient {
         BaseAddress = new Uri(Url)
     };
 }
Beispiel #2
0
        // WARNING: right now it's only used for zone validation, so to be compatible with test environments, we only set the target to be Production
        // This is ok right now since it's nothing important but if you need to call another taxihail server, make sure it's set correctly for your testing
        private string GetUrl(string applicationKey, DeploymentTargets target)
        {
            switch (target)
            {
            case DeploymentTargets.Local:
            case DeploymentTargets.Dev:
                return(string.Format("http://test.taxihail.biz:8181/{0}/", applicationKey));

            case DeploymentTargets.Staging:
                return(string.Format("https://staging.taxihail.com/{0}/", applicationKey));

            case DeploymentTargets.Production:
                return(string.Format("https://api.taxihail.com/{0}/", applicationKey));

            default:
                return(string.Format("http://test.taxihail.biz:8181/{0}/", applicationKey));
            }
        }