Ejemplo n.º 1
0
        public async Task <IAuthedResult <SessionResponse> > LoginAsync(LoginInformation loginInformation)
        {
            loginInformation.GuardAgainstNull();

            using (var requestMessage = new HttpRequestMessage(HttpMethod.Post, "login"))
            {
                requestMessage.Content = new FormUrlEncodedContent(new Dictionary <string, string>
                {
                    { "email", loginInformation.Email },
                    { "password", loginInformation.Password }
                });

                requestMessage.Headers.Add("Session", loginInformation.Session);

                return(await _requester.SendRequestAsync <SessionResponse>(requestMessage).ConfigureAwait(false));
            }
        }