nin*_*nse 8 java cookies android httpclient
我正在尝试发送cookie以及我的HttpGet请求,但每次尝试我都无法成功发送它.我也尝试直接修改标题,这是我的代码:
DefaultHttpClient httpClient = new DefaultHttpClient();
CookieStore store = new BasicCookieStore();
store.addCookie(MyCookieStorageClass.getCookie());
httpClient.setCookieStore(store);
HttpGet httpGet = new HttpGet("http://localhost/);
try {
// Execute HTTP Get Request
HttpResponse response = httpclient.execute(httpGet);
String responseData = ResponseHandler.getResponseBody(response);
} catch (IOException e) {
e.printStackTrace();
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
11915 次 |
| 最近记录: |