资源简介
微信二维码支付项目完整项目
代码片段和文件信息
package com.itheima.util;
import java.io.IOException;
import java.security.GeneralSecurityException;
import java.security.cert.CertificateException;
import java.security.cert.X509Certificate;
import java.text.ParseException;
import java.util.HashMap;
import java.util.linkedList;
import java.util.List;
import java.util.Map;
import javax.net.ssl.SSLContext;
import javax.net.ssl.SSLException;
import javax.net.ssl.SSLSession;
import javax.net.ssl.SSLSocket;
import javax.net.ssl.TrustManager;
import javax.net.ssl.X509TrustManager;
import org.apache.http.Consts;
import org.apache.http.HttpEntity;
import org.apache.http.NameValuePair;
import org.apache.http.client.ClientProtocolException;
import org.apache.http.client.config.RequestConfig;
import org.apache.http.client.entity.UrlEncodedFormEntity;
import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpEntityEnclosingRequestbase;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.client.methods.HttpPut;
import org.apache.http.client.methods.HttpUriRequest;
import org.apache.http.conn.scheme.Scheme;
import org.apache.http.conn.ssl.SSLConnectionSocketFactory;
import org.apache.http.conn.ssl.SSLContextBuilder;
import org.apache.http.conn.ssl.SSLSocketFactory;
import org.apache.http.conn.ssl.TrustStrategy;
import org.apache.http.conn.ssl.X509HostnameVerifier;
import org.apache.http.entity.StringEntity;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.DefaultHttpClient;
import org.apache.http.impl.client.HttpClients;
import org.apache.http.impl.conn.PoolingHttpClientConnectionManager;
import org.apache.http.message.BasicNameValuePair;
import org.apache.http.util.EntityUtils;
/**
* http请求客户端
*
* @author Administrator
*
*/
public class HttpClient {
private String url;
private Map param;
private int statusCode;
private String content;
private String xmlParam;
private boolean isHttps;
public boolean isHttps() {
return isHttps;
}
public void setHttps(boolean isHttps) {
this.isHttps = isHttps;
}
public String getxmlParam() {
return xmlParam;
}
public void setxmlParam(String xmlParam) {
this.xmlParam = xmlParam;
}
public HttpClient(String url Map param) {
this.url = url;
this.param = param;
}
public HttpClient(String url) {
this.url = url;
}
public void setParameter(Map map) {
param = map;
}
public void addParameter(String key String value) {
if (param == null)
param = new HashMap();
param.put(key value);
}
public void post() throws ClientProtocolException IOException {
HttpPost http = new HttpPost(url);
setEntity(http);
execute(http);
}
public void put() throws ClientProtocolException IOException {
HttpPut http = new HttpPut(url);
setEntity(http);
execute(http);
}
public void get() throws ClientProtocolExceptio
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 833 2017-12-05 10:16 代码\wxpay\.classpath
文件 1038 2017-12-05 10:16 代码\wxpay\.project
文件 567 2017-12-05 10:16 代码\wxpay\.settings\.jsdtscope
文件 364 2017-12-05 10:16 代码\wxpay\.settings\org.eclipse.jdt.core.prefs
文件 467 2017-12-05 10:16 代码\wxpay\.settings\org.eclipse.wst.common.component
文件 345 2017-12-05 10:16 代码\wxpay\.settings\org.eclipse.wst.common.project.facet.core.xm
文件 49 2017-12-05 10:16 代码\wxpay\.settings\org.eclipse.wst.jsdt.ui.superType.container
文件 6 2017-12-05 10:16 代码\wxpay\.settings\org.eclipse.wst.jsdt.ui.superType.name
文件 901 2017-12-05 10:45 代码\wxpay\build\classes\com\itheima\util\HttpClient$1.class
文件 6949 2017-12-05 10:45 代码\wxpay\build\classes\com\itheima\util\HttpClient.class
文件 646 2017-12-05 10:45 代码\wxpay\build\classes\com\itheima\util\PayConfig.class
文件 3118 2017-12-05 14:03 代码\wxpay\build\classes\com\itheima\web\CheckStatusServlet.class
文件 2970 2017-12-05 12:53 代码\wxpay\build\classes\com\itheima\web\CreateCodeServlet.class
文件 5170 2017-12-05 10:45 代码\wxpay\src\com\itheima\util\HttpClient.java
文件 467 2017-12-05 10:45 代码\wxpay\src\com\itheima\util\PayConfig.java
文件 2764 2017-12-05 14:03 代码\wxpay\src\com\itheima\web\CheckStatusServlet.java
文件 2799 2017-12-05 12:53 代码\wxpay\src\com\itheima\web\CreateCodeServlet.java
文件 1020 2017-12-05 10:16 代码\wxpay\WebContent\code.html
文件 2008 2017-12-05 12:41 代码\wxpay\WebContent\createCode.jsp
文件 26132 2017-12-05 10:16 代码\wxpay\WebContent\css\bootstrap-theme.css
文件 47721 2017-12-05 10:16 代码\wxpay\WebContent\css\bootstrap-theme.css.map
文件 23357 2017-12-05 10:16 代码\wxpay\WebContent\css\bootstrap-theme.min.css
文件 147430 2017-12-05 10:16 代码\wxpay\WebContent\css\bootstrap.css
文件 390518 2017-12-05 10:16 代码\wxpay\WebContent\css\bootstrap.css.map
文件 122540 2017-12-05 10:16 代码\wxpay\WebContent\css\bootstrap.min.css
文件 795 2017-12-05 10:16 代码\wxpay\WebContent\css\dtree.css
文件 220 2017-12-05 10:16 代码\wxpay\WebContent\css\left.css
文件 786 2017-12-05 10:16 代码\wxpay\WebContent\css\st
文件 12829 2017-12-05 10:16 代码\wxpay\WebContent\css\st
文件 36816 2017-12-05 10:16 代码\wxpay\WebContent\js\bootstrap.min.js
............此处省略104个文件信息
- 上一篇:X32-EDIT_PC_V2.5
- 下一篇:QT 智能家居
评论
共有 条评论