Esempio n. 1
0
 private void HttpWorker_DoWork(object sender, DoWorkEventArgs e)
 {
     string response = "";
     apigeeServer = new ApigeeClient(apigeeUrl, new ApigeeWP7Implementation());
     switch((HttpTools.RequestTypes)e.Argument)
     {
         
         case HttpTools.RequestTypes.Get:
             response = "Getting OrgEvents: " + Environment.NewLine;
             response += apigeeServer.GetUsers().RawResponse;  // wp7Impl.PerformGet(apigeeUrl + "/users");
             break;
         case HttpTools.RequestTypes.Post:
             var user = new ApigeeUser() { Username = "******" + DateTime.Now.Millisecond, Name = "WP7_TestApp User", Email =  "test"+DateTime.Now.Millisecond+"@zaxyinc.com", Password = "******" };
             response = "Creating account for user: "******"(" + user.Email + ")" + Environment.NewLine;
             response += apigeeServer.CreateAppUser(user).RawResponse; //wp7Impl.PerformJsonRequest<string>(apigeeUrl + "/users", HttpTools.RequestTypes.Post, user);
             break;
     }
     e.Result = new KeyValuePair<HttpTools.RequestTypes,string>((HttpTools.RequestTypes)e.Argument,response);
 }
Esempio n. 2
0
        private void HttpWorker_DoWork(object sender, DoWorkEventArgs e)
        {
            string response = "";

            apigeeServer = new ApigeeClient(apigeeUrl, new ApigeeWP7Implementation());
            switch ((HttpTools.RequestTypes)e.Argument)
            {
            case HttpTools.RequestTypes.Get:
                response  = "Getting OrgEvents: " + Environment.NewLine;
                response += apigeeServer.GetUsers().RawResponse;      // wp7Impl.PerformGet(apigeeUrl + "/users");
                break;

            case HttpTools.RequestTypes.Post:
                var user = new ApigeeUser()
                {
                    Username = "******" + DateTime.Now.Millisecond, Name = "WP7_TestApp User", Email = "test" + DateTime.Now.Millisecond + "@zaxyinc.com", Password = "******"
                };
                response  = "Creating account for user: "******"(" + user.Email + ")" + Environment.NewLine;
                response += apigeeServer.CreateAppUser(user).RawResponse;     //wp7Impl.PerformJsonRequest<string>(apigeeUrl + "/users", HttpTools.RequestTypes.Post, user);
                break;
            }
            e.Result = new KeyValuePair <HttpTools.RequestTypes, string>((HttpTools.RequestTypes)e.Argument, response);
        }