我们正在使用 HttpHead 从客户的网站获取信息,但出于某种原因,我们也在响应中获取了 cookie。是预期的吗?有没有办法设置不返回cookie?
以下是我们的代码
HttpClient httpclient = new DefaultHttpClient();
// the time it takes to open TCP connection.
httpclient.getParams().setParameter(CoreConnectionPNames.CONNECTION_TIMEOUT, this.timeout);
// timeout when server does not send data.
httpclient.getParams().setParameter(CoreConnectionPNames.SO_TIMEOUT, this.timeout);
// the head method
HttpHead httphead = new HttpHead(url);
HttpResponse response = httpclient.execute(httphead);
我们收到以下警告,表明也有响应返回的 cookie。
[WARN] ResponseProcessCookies - Cookie 被拒绝:“[版本:0][名称:DXFXFSG][值:AUR][域:...省略...][路径:/][到期:空]”。非法域属性“...省略...”。来源域:“……省略……”