private const string BaseServicesUrl = "http://orangemail.apphb.com/api/"; // Change it... internal static void RegisterUser(string username, string authenticationCode) { UserHelper.ValidateUsername(username); UserHelper.ValidateAuthCode(authenticationCode); var userModel = new UserModel() { Username = username, AuthCode = authenticationCode }; HttpRequester.Post(BaseServicesUrl + "users/register", userModel); }
internal static string LoginUser(string username, string authenticationCode) { UserHelper.ValidateUsername(username); UserHelper.ValidateAuthCode(authenticationCode); var userModel = new UserModel() { Username = username, AuthCode = authenticationCode }; var loginResponse = HttpRequester.Post<LoginResponseModel>(BaseServicesUrl + "users/token", userModel); AccessToken = loginResponse.AccessToken; return loginResponse.Username.ToString(); }