Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 58056

error getting the api key using restsharp

$
0
0

I used the console.writeline to check my values, and they were just empty. Shouldn't I be able to retrieve those values?

var client = new RestClient("http://myproject/");
            var request = new RestRequest("api/ApiKey?email=" + email + "&password=" + password, Method.GET);

            var queryResult = client.Execute(request);

            if (queryResult.StatusCode == HttpStatusCode.OK)
            {
                var deserial = new JsonDeserializer();
                var x = deserial.Deserialize<ApiKey>(queryResult);

                Application.Current.Properties["ApiKey"] = x.UserApiKey;
                Application.Current.Properties ["UserId"] = x.UserId;

                Console.WriteLine ("here");
                Console.WriteLine ("key:"+x.UserApiKey);
                //do this
            }
            else
            {
                // do this

            }

Viewing all articles
Browse latest Browse all 58056

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>