【发布时间】:2011-09-18 03:20:12
【问题描述】:
我正在使用 HttpClient 最新版本 (4.x)。现在我正在尝试做一个 GET 请求。 我只是发布了一个获取请求。
这是我的代码;
public class Poster {
static boolean routing1 = true, routing2 = true;
static int counter1 = 0, counter2 = 0;
DefaultHttpClient oHtp = null;
HttpGet oHGet = null;
HttpResponse oHRes = null;
private void test(String fullAddress) throws Exception {
oHtp = new DefaultHttpClient();
oHGet = new HttpGet(fullAddress);
HttpResponse response = oHtp.execute(oHGet);
System.out.print(response.getStatusLine());
HttpEntity entity = response.getEntity();
if (entity != null) {
entity = new BufferedHttpEntity(entity);
// System.out.println(EntityUtils.toString(entity));
System.out.print("\t entity is retrieved... ");
}
oHtp.getConnectionManager().shutdown();
}
}
我只是很好地执行它。 首先是
new Poster().test("http://123.xl.co.id/profile.php");
第二个是
new Poster().test("http://goklik.co.id/");
是的,只有第二个....我收到了这个错误消息;
2011 年 9 月 18 日上午 10:11:30 org.apache.http.client.protocol.ResponseProcessCookies processCookies 警告:Cookie 被拒绝:“[版本:0][名称:CookiePst][值: 0149=xwGHF7HYDHLHQ84Isp/eSy9vu+Xq6cT12wxg1A==][域: .mcore.com][path: /][expiry: Sun Sep 18 10:38:59 ICT 2011]"。非法 域属性“mcore.com”。来源域:“goklik.co.id”
我意识到这里涉及到 Cookie。但我不明白警告的含义。而且我也不知道如何解决(Cookie没有被拒绝)。希望有一点光明可以让你们清除我的思绪....:D
【问题讨论】:
标签: java cookies warnings httpclient