-
大小: 3.28MB文件类型: .zip金币: 1下载: 0 次发布日期: 2023-11-08
- 语言: Java
- 标签: httpclient
资源简介
commons-codec-1.6.jar commons-logging-1.1.1.jar fluent-hc-4.2.1.jar httpclient-4.2.1.jar httpclient-cache-4.2.1.jar httpcore-4.2.1.jar httpmime-4.2.1.jar
代码片段和文件信息
/*
* ====================================================================
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License Version 2.0 (the
* “License“); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing
* software distributed under the License is distributed on an
* “AS IS“ BASIS WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
* ====================================================================
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation. For more
* information on the Apache Software Foundation please see
* .
*
*/
package org.apache.http.examples.client;
import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
import org.apache.http.client.HttpClient;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.impl.client.DefaultHttpClient;
/**
* This example demonstrates how to abort an HTTP method before its normal completion.
*/
public class ClientAbortMethod {
public final static void main(String[] args) throws Exception {
HttpClient httpclient = new DefaultHttpClient();
try {
HttpGet httpget = new HttpGet(“http://www.apache.org/“);
System.out.println(“executing request “ + httpget.getURI());
HttpResponse response = httpclient.execute(httpget);
HttpEntity entity = response.getEntity();
System.out.println(“----------------------------------------“);
System.out.println(response.getStatusLine());
if (entity != null) {
System.out.println(“Response content length: “ + entity.getContentLength());
}
System.out.println(“----------------------------------------“);
// Do not feel like reading the response body
// Call abort on the request object
httpget.abort();
} finally {
// When HttpClient instance is no longer needed
// shut down the connection manager to ensure
// immediate deallocation of all system resources
httpclient.getConnectionManager().shutdown();
}
}
}
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2012-06-29 20:40 httpcomponents-client-4.2.1\
目录 0 2012-06-29 20:40 httpcomponents-client-4.2.1\examples\
目录 0 2012-06-29 20:40 httpcomponents-client-4.2.1\examples\org\
目录 0 2012-06-29 20:40 httpcomponents-client-4.2.1\examples\org\apache\
目录 0 2012-06-29 20:40 httpcomponents-client-4.2.1\examples\org\apache\http\
目录 0 2012-06-29 20:40 httpcomponents-client-4.2.1\examples\org\apache\http\examples\
目录 0 2012-06-29 20:40 httpcomponents-client-4.2.1\examples\org\apache\http\examples\client\
目录 0 2012-06-29 20:40 httpcomponents-client-4.2.1\examples\org\apache\http\examples\conn\
目录 0 2012-06-29 20:40 httpcomponents-client-4.2.1\examples\org\apache\http\examples\entity\
目录 0 2012-06-29 20:40 httpcomponents-client-4.2.1\examples\org\apache\http\examples\entity\mime\
目录 0 2012-06-29 20:40 httpcomponents-client-4.2.1\javadoc\
目录 0 2012-06-29 20:39 httpcomponents-client-4.2.1\javadoc\org\
目录 0 2012-06-29 20:39 httpcomponents-client-4.2.1\javadoc\org\apache\
目录 0 2012-06-29 20:39 httpcomponents-client-4.2.1\javadoc\org\apache\http\
目录 0 2012-06-29 20:40 httpcomponents-client-4.2.1\javadoc\org\apache\http\auth\
目录 0 2012-06-29 20:40 httpcomponents-client-4.2.1\javadoc\org\apache\http\auth\class-use\
目录 0 2012-06-29 20:40 httpcomponents-client-4.2.1\javadoc\org\apache\http\auth\params\
目录 0 2012-06-29 20:40 httpcomponents-client-4.2.1\javadoc\org\apache\http\auth\params\class-use\
目录 0 2012-06-29 20:40 httpcomponents-client-4.2.1\javadoc\org\apache\http\client\
目录 0 2012-06-29 20:40 httpcomponents-client-4.2.1\javadoc\org\apache\http\client\cache\
目录 0 2012-06-29 20:40 httpcomponents-client-4.2.1\javadoc\org\apache\http\client\cache\class-use\
目录 0 2012-06-29 20:40 httpcomponents-client-4.2.1\javadoc\org\apache\http\client\class-use\
目录 0 2012-06-29 20:40 httpcomponents-client-4.2.1\javadoc\org\apache\http\client\entity\
目录 0 2012-06-29 20:40 httpcomponents-client-4.2.1\javadoc\org\apache\http\client\entity\class-use\
目录 0 2012-06-29 20:40 httpcomponents-client-4.2.1\javadoc\org\apache\http\client\fluent\
目录 0 2012-06-29 20:40 httpcomponents-client-4.2.1\javadoc\org\apache\http\client\fluent\class-use\
目录 0 2012-06-29 20:40 httpcomponents-client-4.2.1\javadoc\org\apache\http\client\methods\
目录 0 2012-06-29 20:40 httpcomponents-client-4.2.1\javadoc\org\apache\http\client\methods\class-use\
目录 0 2012-06-29 20:40 httpcomponents-client-4.2.1\javadoc\org\apache\http\client\params\
目录 0 2012-06-29 20:40 httpcomponents-client-4.2.1\javadoc\org\apache\http\client\params\class-use\
目录 0 2012-06-29 20:40 httpcomponents-client-4.2.1\javadoc\org\apache\http\client\protocol\
............此处省略883个文件信息
相关资源
- HttpClient配置SSL绕过https证书
- Android网络请求
- httpclient 相关的 3个jar包(commons-http
- httpclient 全部JAR包
- java httpclient https或http及文件中转上传
- java模拟淘宝登录源码请看评论,酌情
- java 调用webservice使用HttpClient和XFire两
- android HttpClient jar包
- HttpClient方式实现Android平台与Apache服务
- httpclient4.2.5 jar 还有关于他的依赖包
- Android使用HttpClient和HttpsUrlConnection两种
- httpclient需要的各种jar包
- java使用httpClient模拟淘宝登陆
- httpclient 4.4 jar包
- HttpClient4.2.5
- HttpClient-4.5.6
- org.apache.http的jar包是使用HttpClient发送
- httpcomponents-client-4.5.4
- httpclient-4.5.3完整jar包
- httpclient 需要的各种jar包 全版本
- httpclient爬取美图
- Android-async-http-1.4.9.jar
- Java中Httpclient需要的jar包(httpclient.
- OkHttpClientUtil封装类
- java使用HttpClient通过url文件到本地
- java httpclient 模拟登录
- Android_HttpClient_jar包
- AsyncHttpClient所需的jar包
- httpclient-android-4.3.5.1.jar
- httpclient-4.3.6.jar架包
评论
共有 条评论