Ejemplo n.º 1
0
 public bool Register(RegistrationRequest request)
 {
     string body = JsonConvert.SerializeObject(request);
     HttpResponseMessage response = client.PostAsync(address + "/users/" + request.Login, new StringContent(body, Encoding.UTF8, "application/json")).Result;
     return response.IsSuccessStatusCode;
 }
 public bool Register(string login, string password)
 {
     RegistrationRequest request = new RegistrationRequest { Login = login, Password = password, Firstname = "Imię", Lastname = "Nazwisko",Avatar = "", Bio= "" };
     bool result = client.Register(request);
     if (result)
     {
         Name = login;
         user = client.getUser(login);
         filesaver.saveFile(JsonConvert.SerializeObject(user));
         //[email protected]
         //[email protected]
         return true;
     }
     else
     {
         return false;
     }
 }