| | |
| | | } |
| | | |
| | | //适用于post请求并传送form-data数据(同样适用于post的Raw类型的application-json格式) |
| | | public static String postParams(String url, String appKey, String appKeyValue, Map<String, String> map) { |
| | | public static String postParams(String url, String appKey, Map<String, String> map) { |
| | | SSLContext sslcontext = null; |
| | | try { |
| | | sslcontext = createIgnoreVerifySSL(); |
| | |
| | | //创建自定义的httpclient对象 |
| | | CloseableHttpClient client = HttpClients.custom().setConnectionManager(connManager).build(); |
| | | HttpPost post = new HttpPost(url); |
| | | post.setHeader(appKey, appKeyValue); |
| | | post.setHeader("appKey", appKey); |
| | | CloseableHttpResponse res = null; |
| | | try { |
| | | List<NameValuePair> nvps = new ArrayList<NameValuePair>(); |