Exemplo n.º 1
0
 public static HttpReceiver GetReceiver()
 {
     if (Instance == null)
     {
         Instance = new HttpReceiver();
     }
     return(Instance);
 }
Exemplo n.º 2
0
        public override HttpResponseMessage Execute()
        {
            var credentialsJson = JsonConvert.SerializeObject(credentials);
            var httpClient      = HttpReceiver.GetReceiver();

            var res = httpClient.PostJson(endpoint, credentialsJson);

            return(res);
        }
Exemplo n.º 3
0
        private void GenerateToken()
        {
            var credentialsss = new Credentials
            {
                Username = "******",
                Password = "******",
            };
            AuthenticationCommand command = new AuthenticationCommand(credentialsss);
            var auth  = InternalExecute(command);
            var token = JsonConvert.DeserializeObject <Token>(auth);

            HttpReceiver.GetReceiver().SetToken(token.Id_Token);
        }
Exemplo n.º 4
0
        public override HttpResponseMessage Execute()
        {
            var reciever = HttpReceiver.GetReceiver();

            return(reciever.Get(endpoint));
        }