资源简介
apache httpclient jar包 httpcomponents-client-4.2.5
代码片段和文件信息
/*
* ====================================================================
* 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 2018-06-12 12:51 httpcomponents-client-4.2.5\
目录 0 2018-06-12 12:51 httpcomponents-client-4.2.5\examples\
目录 0 2018-06-12 12:51 httpcomponents-client-4.2.5\examples\org\
目录 0 2018-06-12 12:51 httpcomponents-client-4.2.5\examples\org\apache\
目录 0 2018-06-12 12:51 httpcomponents-client-4.2.5\examples\org\apache\http\
目录 0 2018-06-12 12:51 httpcomponents-client-4.2.5\examples\org\apache\http\examples\
目录 0 2018-06-12 12:51 httpcomponents-client-4.2.5\examples\org\apache\http\examples\client\
文件 2740 2013-04-20 00:17 httpcomponents-client-4.2.5\examples\org\apache\http\examples\client\ClientAbortMethod.java
文件 2921 2013-04-20 00:17 httpcomponents-client-4.2.5\examples\org\apache\http\examples\client\ClientAuthentication.java
文件 3640 2013-04-20 00:17 httpcomponents-client-4.2.5\examples\org\apache\http\examples\client\ClientChunkEncodedPost.java
文件 3770 2013-04-20 00:17 httpcomponents-client-4.2.5\examples\org\apache\http\examples\client\ClientConnectionRelease.java
文件 3680 2013-04-20 00:17 httpcomponents-client-4.2.5\examples\org\apache\http\examples\client\ClientCustomContext.java
文件 3363 2013-04-20 00:17 httpcomponents-client-4.2.5\examples\org\apache\http\examples\client\ClientCustomSSL.java
文件 4870 2013-04-20 00:17 httpcomponents-client-4.2.5\examples\org\apache\http\examples\client\ClientEvictExpiredConnections.java
文件 2877 2013-04-20 00:17 httpcomponents-client-4.2.5\examples\org\apache\http\examples\client\ClientExecuteDirect.java
文件 3102 2013-04-20 00:17 httpcomponents-client-4.2.5\examples\org\apache\http\examples\client\ClientExecuteProxy.java
文件 5760 2013-04-20 00:17 httpcomponents-client-4.2.5\examples\org\apache\http\examples\client\ClientExecuteSOCKS.java
文件 4182 2013-04-20 00:17 httpcomponents-client-4.2.5\examples\org\apache\http\examples\client\ClientFormLogin.java
文件 5472 2013-04-20 00:17 httpcomponents-client-4.2.5\examples\org\apache\http\examples\client\ClientGZipContentCompression.java
文件 5318 2013-04-20 00:17 httpcomponents-client-4.2.5\examples\org\apache\http\examples\client\ClientInteractiveAuthentication.java
文件 6693 2013-04-20 00:17 httpcomponents-client-4.2.5\examples\org\apache\http\examples\client\ClientKerberosAuthentication.java
文件 4820 2013-04-20 00:17 httpcomponents-client-4.2.5\examples\org\apache\http\examples\client\ClientMultiThreadedExecution.java
文件 4089 2013-04-20 00:17 httpcomponents-client-4.2.5\examples\org\apache\http\examples\client\ClientPreemptiveBasicAuthentication.java
文件 4356 2013-04-20 00:17 httpcomponents-client-4.2.5\examples\org\apache\http\examples\client\ClientPreemptiveDigestAuthentication.java
文件 3361 2013-04-20 00:17 httpcomponents-client-4.2.5\examples\org\apache\http\examples\client\ClientProxyAuthentication.java
文件 2653 2013-04-20 00:17 httpcomponents-client-4.2.5\examples\org\apache\http\examples\client\ClientWithResponseHandler.java
文件 2835 2013-04-20 00:17 httpcomponents-client-4.2.5\examples\org\apache\http\examples\client\ProxyTunnelDemo.java
文件 3468 2013-04-20 00:17 httpcomponents-client-4.2.5\examples\org\apache\http\examples\client\QuickStart.java
目录 0 2018-06-12 12:51 httpcomponents-client-4.2.5\examples\org\apache\http\examples\conn\
文件 4458 2013-04-20 00:17 httpcomponents-client-4.2.5\examples\org\apache\http\examples\conn\OperatorConnectDirect.java
文件 6992 2013-04-20 00:17 httpcomponents-client-4.2.5\examples\org\apache\http\examples\conn\OperatorConnectProxy.java
............此处省略883个文件信息
相关资源
- HDP java代码,非参数主题模型学习算法
- EM算法java实现
- PDFRenderer-0.9.0.jar
- 使用JSP+Servlet实现商品管理功能,后台
- javaweb结合onvif视频实时监控项目源码
- java设计毕业答辩ppt讲解.ppt
- 基于Java的网上家具商城
- zw_java视频聊天anychat.zip
- java图书管理系统.zip
- mysql-connector-java-8.0.19_仅含jar包.zip
- 基于java的WEB的仓库管理系统的设计与
-
Java Java Java ob
ject-Oriented Problem Solv - 基于Java的物流信息网站的设计
- 基于Java的企业员工信息管理系统
- 基于Java的个人博客系统的设计与实现
- java web 教务系统大作业实验报告含代
- java源码 亲测java 酒店管理系统(含
- java教材ppt
- 牛客网校招面试题库附答案与解析j
- 一个简单的电商系统
- java jsp 数据库mySQL 网上购书系统实训
- 基于java开发的二手图书交易系统设计
- JavaWeb实现名片管理系统
- Javaweb图书管理系统--完整项目图书商
- java基础思维导图.xmind
- myEclipse实现购物车
- Java基础 全套源代码
- java课程设计——记忆测试系统和课程
- 博客系统sshjavaweb.zip
- javaPOI ssm导入导出
评论
共有 条评论