Пример #1
0
        public async Task <HttpResponseMessage> Put()
        {
            HttpContent requestContent = Request.Content;
            string      jsonContent    = await requestContent.ReadAsStringAsync();

            LoginSession loginSession = JsonConvert.DeserializeObject <LoginSession>(jsonContent);

            if (_sessionManager.AuthenticateSession(loginSession))
            {
                return(new HttpResponseMessage(System.Net.HttpStatusCode.OK));
            }
            else
            {
                return(new HttpResponseMessage(System.Net.HttpStatusCode.Unauthorized));
            }
        }