AK.F1.Timing.Live.LiveAuthenticationService.FetchLoginResponseCookies C# (CSharp) Method

FetchLoginResponseCookies() private static method

private static FetchLoginResponseCookies ( string username, string password ) : CookieCollection
username string
password string
return System.Net.CookieCollection
        private static CookieCollection FetchLoginResponseCookies(string username, string password)
        {
            try
            {
                return LoginUri.GetResponseCookies(HttpMethod.Post, request =>
                {
                    byte[] content = GetLoginRequestContent(username, password);
                    request.ContentType = AuthContentType;
                    request.ContentLength = content.Length;
                    request.Referer = LoginRequestReferer;
                    using(var stream = request.GetRequestStream())
                    {
                        stream.Write(content, 0, content.Length);
                    }
                });
            }
            catch(IOException exc)
            {
                Log.Error(exc);
                throw Guard.LiveAuthenticationService_FailedToFetchAuthToken(exc);
            }
        }