Beispiel #1
0
    public RSG.IPromise <bool> Register(RLoginData loginData)
    {
        currentRequest = new RequestHelper
        {
            Uri         = basepath + "register",
            Body        = loginData,
            EnableDebug = true
        };

        return(new RSG.Promise <bool>((resolve, reject) =>
        {
            RestClient.Post <Post>(currentRequest).Then((arg) => resolve(true)).Catch((obj) => reject(obj));
        }
                                      ));
    }
Beispiel #2
0
    // Use this for initialization

    public RSG.IPromise <RUserRespnse> Authenticate(RLoginData loginData)
    {
        currentRequest = new RequestHelper
        {
            Uri         = basepath + "authenticate",
            Body        = loginData,
            EnableDebug = true
        };
        return(new RSG.Promise <RUserRespnse>((resolve, reject) =>
        {
            RestClient.Post <RAuthResponse>(currentRequest).Then((arg) => {
                this.bearerToken = arg.token;
                resolve(arg);
            }).Catch((obj) => reject(obj));
        }));
    }