コード例 #1
0
        public async Task <ExpandoObject> GetCurrentLevel(string url, IRequestCookieCollection cookies)
        {
            using (var fc = new FlurlClient().EnableCookies())
            {
                var cookieList = cookies.ToList();

                foreach (var cookie in cookieList)
                {
                    fc.Cookies.Add(cookie.Key, new Cookie(cookie.Key, cookie.Value));
                }

                var response = await url
                               .WithClient(fc)
                               .GetJsonAsync();

                return(response);
            }
        }