Http连接getInputStream空指针异常android

时间:2015-02-21 15:44:11

标签: android http url exception https

我在方法getInputStream()上得到空指针异常,我知道urlConnection不为null

URL url = new URL(strUrl);

        /** Creating an http connection to communcate with url */
        HttpURLConnection urlConnection = (HttpURLConnection) url.openConnection();

        /** Connecting to url */
        urlConnection.connect();

        /** Reading data from url */
        iStream = urlConnection.getInputStream();

Url字符串很好我在浏览器中查看它。 谢谢。

0 个答案:

没有答案