Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Leaf.xNet.HttpRequest.Cookies.**get** returned null. #43

Closed
ghost opened this issue Jun 19, 2019 · 1 comment
Closed

Leaf.xNet.HttpRequest.Cookies.**get** returned null. #43

ghost opened this issue Jun 19, 2019 · 1 comment

Comments

@ghost
Copy link

ghost commented Jun 19, 2019

using Leaf.xNet;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Poe_StashAndMtx_Dump
{
    class Program
    {
        private const string _cookieAuth = "POESESSID=0781497aaa664ae602890520936f6;";

        private static string Request(string url/*, ref CookieDictionary cookies*/)
        {
            using (var request = new HttpRequest())
            {
                HttpResponse response;
                request.Cookies.Set("POESESSID", "0781497aaa664ae60289936f83c6", ".pathofexile.com", "/");
                //request.Cookies = _cookieAuth;
                request.ConnectTimeout = 30 * 1000;
                request.ReadWriteTimeout = 30 * 1000;
                request.UserAgentRandomize();
                request.AllowAutoRedirect = false;
                request.Referer = "";

                response = request.Get(url);

                //cookies = response.Cookies;

                return response.ToString();
            }
        }
        static void Main(string[] args)
        {
            var accountName = "melirench";
            var league = "Legion";
            var getStash = Request("https://www.pathofexile.com/character-window/get-stash-items?accountName="+ accountName + "&realm=pc&league="+league+"&tabs=1&tabIndex=0&public=false");
        }
    }
}

Чем может быть вызвана проблема?

@grandsilence
Copy link
Member

Перед использованием нужно указать:

httpRequest.Cookies = new CookieStorage();

@ghost ghost closed this as completed Jun 26, 2019
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant