HttpURLConnection发送和接受返回值

Posted Dota_小川

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了HttpURLConnection发送和接受返回值相关的知识,希望对你有一定的参考价值。

     URL url = new URL(sb.toString());//请求的地址
        HttpURLConnection connection = (HttpURLConnection) url.openConnection();
        connection.setRequestMethod("POST");//请求方式
        BufferedReader in = new BufferedReader(new InputStreamReader(
                url.openStream()));
     //返回结果
        String inputline = in.readLine();
     System.out.println(inputline);

 

以上是关于HttpURLConnection发送和接受返回值的主要内容,如果未能解决你的问题,请参考以下文章