Exemplo n.º 1
0
        public async void LoadProfile()
        {
            var response = await MyApiService.GetRequest("/profile/");

            this.Response = await response.Content.ReadAsStringAsync();

            this.ProfileData = JsonConvert.DeserializeObject <Profile>(this.Response);
        }
Exemplo n.º 2
0
        public async void AttemptLogin()
        {
            var json     = JsonConvert.SerializeObject(AttemptingUser);
            var response = await MyApiService.PostRequest("/auth/login/", json);

            this.Response = await response.Content.ReadAsStringAsync();

            var accessToken = JsonConvert.DeserializeObject <AccessToken>(this.Response).Value;

            Application.Current.Properties["token"] = accessToken;
            this.Response = accessToken;
        }