HttpClient WARNING: Cookie rejected: Illegal domain attribute

前端 未结 7 781
慢半拍i
慢半拍i 2020-12-09 03:36

I\'m using HttpClient latest version (4.x). And right now I\'m trying to do A GET Request. I just posting a Get request.

This is my Code;

public clas         


        
相关标签:
7条回答
  • 2020-12-09 04:11

    Maybe it's too late, but I had the same problem and I've found something that helped me work it out, just set the Cookie Policy to Browser Compability:

    httpclient.getParams().setParameter(ClientPNames.COOKIE_POLICY,
            CookiePolicy.BROWSER_COMPATIBILITY);
    

    Here are the possible values:

    The cookie policy provides corresponding cookie management interfrace for a given type or version of cookie.

    RFC 2109 specification is used per default. Other supported specification can be chosen when appropriate or set default when desired

    The following specifications are provided:

    • BROWSER_COMPATIBILITY: compatible with the common cookie management practices (even if they are not 100% standards compliant)
    • NETSCAPE: Netscape cookie draft compliant
    • RFC_2109: RFC2109 compliant (default)
    • IGNORE_COOKIES: do not automcatically process cookies
    0 讨论(0)
提交回复
热议问题