Ejemplo n.º 1
0
        public Request()
        {
            Cookie = new CookieContainer();
            Cookie.Add(new Cookie("osu_site_v", "old", "/", "osu.ppy.sh"));

            Handler = new CloudFlareHandler(new HttpClientHandler
            {
                CookieContainer = Cookie,
            });

            Client = new HttpClient(Handler)
            {
                Timeout = TimeSpan.FromSeconds(Settings.ResponseTimeout),
            };
        }
        public OsuLegacyClient()
        {
            CookieContainer = new CookieContainer();
            AddCookie("osu_site_v", "old");

            Handler = new CloudFlareHandler(new HttpClientHandler
            {
                CookieContainer = CookieContainer,
            });

            Client = new HttpClient(Handler)
            {
                BaseAddress = BaseAddress,
                Timeout     = Settings.ResponseTimeout,
            };
            Client.DefaultRequestHeaders.Add("Referer", BaseAddress.AbsoluteUri);
        }