行业网站建设_自助建站_重庆网站建设公司_江门网站优化

武汉网站优化

手机网站制作、建设一个公司网站、永久使用、不限域名、成都网站建设冠辰

台州网站优化?

行业网站建设_自助建站_重庆网站建设公司_江门网站优化

public class WechatPayRequest {@Resourceprivate CloseableHttpClient wxPayClient;public String wechatHttpGet(String url) {try {// 拼接请求参数HttpGet httpGet = new HttpGet(url);httpGet.setHeader("Accept", "application/json");//完成签名并执行请求CloseableHttpResponse response = wxPayClient.execute(httpGet);return getResponseBody(response);}catch (Exception e){throw new RuntimeException(e.getMessage());}}public String wechatHttpPost(String url,String paramsStr) {try {HttpPost httpPost = new HttpPost(url);StringEntity entity = new StringEntity(paramsStr, "utf-8");entity.setContentType("application/json");httpPost.setEntity(entity);httpPost.setHeader("Accept", "application/json");CloseableHttpResponse response = wxPayClient.execute(httpPost);return getResponseBody(response);}catch (Exception e){throw new RuntimeException(e.getMessage());}}private String getResponseBody(CloseableHttpResponse response) throws IOException {//响应体HttpEntity entity = response.getEntity();String body = entity==null?"":EntityUtils.toString(entity);//响应状态码int statusCode = response.getStatusLine().getStatusCode();//处理成功,204是,关闭订单时微信返回的正常状态码if (statusCode == HttpStatus.SC_OK || statusCode == HttpStatus.SC_NO_CONTENT) {log.info("成功, 返回结果 = " + body);} else {String msg = "微信支付请求失败,响应码 = " + statusCode + ",返回结果 = " + body;log.error(msg);throw new RuntimeException(msg);}return body;} 公司建站移动开发苏州做网站长沙网页设计公司丽江网络推广湘潭网站优化微信公众帐号开发濮阳做网站门户网站建设新乡网站优化邵阳网站建设三亚做网站大兴网站设计专业的网站建设公司wangzhan郑州app开发价格安卓软件开发温州网站设计三明seo成都做网站物联网系统开发蚌埠seo高端网站建设设计公司跑腿app开发济南手工网站建设邢台网站推广阳江网站制作公司网约车app开发oa系统开发网站建设的费用建官网公司

猜你喜欢