首页 > 学院 > 开发设计 > 正文

java数据传给wap站点

2019-11-17 04:15:22
字体:
来源:转载
供稿:网友

 /**
     * 数据传给wap站点
     *
     * @param message
     * @throws IOException
     */
    PRivate void settoWap(String message) throws IOException {
        URL url;
        try {
            url = new URL(
                    "http://www.devdao.com/colgate/inc/msgvote.php?imgid="
                            + message+"&mobile="+phone);
            HttpURLConnection connection = (HttpURLConnection) url
                    .openConnection();
            connection.setRequestMethod("POST");
            connection.setDoOutput(true);
            PrintWriter out = new PrintWriter(connection.getOutputStream());
            out.close();
            BufferedReader in = new BufferedReader(new InputStreamReader(
                    connection.getInputStream()));
            String line;
            while ((line = in.readLine()) != null) {
                LogTool.WriteLog(line);
                System.out.println(line);
            }
            in.close();

        } catch (MalformedURLException e) {
            e.printStackTrace();
        }

    }


发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表