org.apache.http.client.methods.HttpDelete#abort()源码实例Demo

下面列出了org.apache.http.client.methods.HttpDelete#abort() 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: charging_pile_cloud   文件: HttpClientUtil.java
/**
 * 封装HTTP DELETE方法
 *
 * @param
 * @return
 */
public static String delete(String url) throws ClientProtocolException, IOException {
    HttpClient httpClient = new DefaultHttpClient();
    HttpDelete httpDelete = new HttpDelete();
    httpDelete.setURI(URI.create(url));
    HttpResponse response = httpClient.execute(httpDelete);
    String httpEntityContent = getHttpEntityContent(response);
    httpDelete.abort();
    return httpEntityContent;
}
 
源代码2 项目: charging_pile_cloud   文件: HttpClientUtil.java
/**
 * 封装HTTP DELETE方法
 *
 * @param
 * @param
 * @return
 */
public static String delete(String url, Map<String, String> paramMap)
        throws ClientProtocolException, IOException {
    HttpClient httpClient = new DefaultHttpClient();
    HttpDelete httpDelete = new HttpDelete();
    List<NameValuePair> formparams = setHttpParams(paramMap);
    String param = URLEncodedUtils.format(formparams, "UTF-8");
    httpDelete.setURI(URI.create(url + "?" + param));
    HttpResponse response = httpClient.execute(httpDelete);
    String httpEntityContent = getHttpEntityContent(response);
    httpDelete.abort();
    return httpEntityContent;
}
 
源代码3 项目: flash-waimai   文件: HttpClients.java
/**
 * 封装HTTP DELETE方法
 *
 * @param
 * @return
 * @throws ClientProtocolException
 * @throws IOException
 */
public static String delete(String url) throws ClientProtocolException, IOException {
	HttpClient httpClient = new DefaultHttpClient();
	HttpDelete httpDelete = new HttpDelete();
	httpDelete.setURI(URI.create(url));
	HttpResponse response = httpClient.execute(httpDelete);
	String httpEntityContent = getHttpEntityContent(response);
	httpDelete.abort();
	return httpEntityContent;
}
 
源代码4 项目: flash-waimai   文件: HttpClients.java
/**
 * 封装HTTP DELETE方法
 *
 * @param
 * @param
 * @return
 * @throws ClientProtocolException
 * @throws IOException
 */
public static String delete(String url, Map<String, String> paramMap) throws ClientProtocolException, IOException {
	HttpClient httpClient = new DefaultHttpClient();
	HttpDelete httpDelete = new HttpDelete();
	List<NameValuePair> formparams = setHttpParams(paramMap);
	String param = URLEncodedUtils.format(formparams, "UTF-8");
	httpDelete.setURI(URI.create(url + "?" + param));
	HttpResponse response = httpClient.execute(httpDelete);
	String httpEntityContent = getHttpEntityContent(response);
	httpDelete.abort();
	return httpEntityContent;
}