当前位置:   article > 正文

微信用户绑定java实例_java 获取微信 页面授权 获取用户openid(示例代码)

java实现qq微信账号关联

1 packagecom.yulv.utils;2

3 importjava.io.BufferedReader;4 importjava.io.IOException;5 importjava.io.InputStream;6 importjava.io.InputStreamReader;7 importjava.io.OutputStream;8 importjava.io.OutputStreamWriter;9 importjava.net.HttpURLConnection;10 importjava.net.InetSocketAddress;11 importjava.net.Proxy;12 importjava.net.URL;13 importjava.net.URLConnection;14 importjava.util.Iterator;15 importjava.util.Map;16

17

18 public classHttpRequestor {19 private String charset = "utf-8";20 private Integer connectTimeout = null;21 private Integer socketTimeout = null;22 private String proxyHost = null;23 private Integer proxyPort = null;24

25 /**

26 * Do GET request27 *@paramurl28 *@return

29 *@throwsException30 *@throwsIOException31 */

32 public String doGet(String url) throwsException {33

34 URL localURL = newURL(url);35

36 URLConnection connection =openConnection(localURL);37 HttpURLConnection httpURLConnection =(HttpURLConnection)connection;38

39 httpURLConnection.setRequestProperty("Accept-Charset", charset);40 httpURLConnection.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");41

42 InputStream inputStream = null;43 InputStreamReader inputStreamReader = null;44 BufferedReader reader =

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/小惠珠哦/article/detail/746070
推荐阅读
相关标签
  

闽ICP备14008679号