示例#1
0
 public string GetPagesById(string id)
 {
     RestClient = new RestClient.RestClient {
         EndPoint = Pages + id, HttpMethod = Prototype.RestClient.RestClient.HttpVerb.GET
     };
     return(Response = RestClient.DoRequest());
 }
示例#2
0
 public string GetCourses()
 {
     RestClient = new RestClient.RestClient {
         EndPoint = Courses, HttpMethod = Prototype.RestClient.RestClient.HttpVerb.GET
     };
     return(Response = RestClient.DoRequest());
 }
示例#3
0
        public ClientBaseTests(ClientFixture clientFixture)
        {
            var restClient = new RestClient.RestClient(clientFixture.Server.CreateHandler())
            {
                BaseAddress = clientFixture.Server.BaseAddress
            };

            Client = new WebApiClient(restClient);
            Server = clientFixture.Server;
        }
        private static ServiceDiscoveryClient GetServiceDiscoveryClient()
        {
            var serviceDiscoveryConfiguration = new ServiceDiscoveryConfiguration();

            serviceDiscoveryConfiguration.ServiceUrl = "http://localhost:5000/service-discovery";
            var settings               = Options.Create(serviceDiscoveryConfiguration);
            var restClient             = new RestClient.RestClient();
            var serviceDiscoveryClient = new ServiceDiscoveryClient(settings);

            return(serviceDiscoveryClient);
        }
示例#5
0
        public async void LoadAndPlayGame(int id, AppShell appShell)
        {
            var restClient = new RestClient.RestClient();

            var gameResource = await restClient.GetFullGameByIdAsync(id);

            var converter = new FullGameConverter();

            var game = converter.Convert(gameResource);

            LocationChecker = new LocationChecker();

            AppShell = appShell;

            Model = game;

            MapService = new MapService(AppShell);

            Introduction = new IntroductionViewModel(AppShell, Model.Introduction.Title);

            if (Model.Introduction.DisplayObjects != null)
            {
                foreach (DisplayObject obj in Model.Introduction.DisplayObjects)
                {
                    Introduction.AddDisplayObject(obj);
                }
            }

            Text InfoAboutGame = new Text()
            {
                Title = "Hráči, kteří se podíleli na této hře",
                PositionInIntroduction = 0,
                OwnText = ""
            };

            foreach (User user in Model.Owners)
            {
                InfoAboutGame.OwnText = InfoAboutGame.OwnText + user.UserName + " ";
            }

            Introduction.AddText(InfoAboutGame);

            if (Model.Introduction.MapPositions != null)
            {
                MapService.AddNotStops(Model.Introduction.MapPositions as List <MapPosition>);
            }

            StartingTime = DateTime.UtcNow;

            foreach (Stop stop in Model.Stops)
            {
                SetUpStopModel(stop);
            }
        }
        public void ShowSentence()
        {
            //Instantiation of our RestClient object
            RestClient = new RestClient.RestClient {
                EndPoint = url
            };
            string Response = RestClient.DoRequest();

            Console.WriteLine(Response.ToString());
            Sentences = JsonConvert.DeserializeObject <List <Cloze> >(Response);
            DoTransitions();
        }
示例#7
0
        public void ShowQuestions()
        {
            //Instantiation of our RestClient object
            RestClient = new RestClient.RestClient {
                EndPoint = url
            };
            string Response = RestClient.DoRequest();

            Console.WriteLine(Response.ToString());
            //JsonCovert does exactly what is says...
            Contents = JsonConvert.DeserializeObject <List <Content> >(Response);
            ModifyData();
            DoTransition();
        }
示例#8
0
        //connexion au fichier json

        private void btnActualiser_Click(object sender, EventArgs e)
        {
            RestClient.RestClient rClient = new RestClient.RestClient();

            rClient.endPoint = "https://data.geo.admin.ch/ch.meteoschweiz.messwerte-windgeschwindigkeit-kmh-10min/ch.meteoschweiz.messwerte-windgeschwindigkeit-kmh-10min_en.json";
            debugOutput("RESTClient Object created.");

            string strJSON = string.Empty;

            strJSON = rClient.makeRequest();

            debugOutput(strJSON);

            string resultatRequete = strJSON;
            //Deserialiseur strconvert = new Deserialiseur(resultatRequete);
        }
        public void ResolvableServiceClient_GetProducts()
        {
            const string productId = "008f6f44-9cce-4358-82f0-c7a26675f2b9";

            var restClient             = new RestClient.RestClient();
            var serviceDiscoveryClient = GetServiceDiscoveryClient();

            var serviceClient = new ResolvableServiceClient("products", "v1", serviceDiscoveryClient, restClient);

            var request = new RestRequest()
                          .AddUrlSegment(productId)
                          .AddToken(Token);

            var response = serviceClient.Get <GetProductResponse>(request);

            var result = response;
        }
示例#10
0
 public AbstractController()
 {
     restClient = new RestClient.RestClient();
 }