违反 RFC 2109:host > minus 域不能包含任何点

Violates RFC 2109: host > minus domain may not contain any dots

当我尝试将 cookie 设置为 Apache httpget 请求时,我遇到了这个问题:

error.violates RFC 2109: host minus domain may not contain any dots

我在代码中添加以下行,然后问题就解决了。

httpGet.getParams().setParameter(ClientPNames.ALLOW_CIRCULAR_REDIRECTS, true);

httpGet.getParams().setParameter(ClientPNames.COOKIE_POLICY, CookiePolicy.RFC_2965);