我正在HttpUrlConnection
使用URL
. 在浏览器URL
中给我响应,但在下面的代码中InputStream
响应是0
. 为什么?
这是我的代码:
URL url = new URL("https://certify.securenet.com/payment.scrnt");
HttpURLConnection httpCon = (HttpURLConnection)url.openConnection();
InputStream in = httpCon.getInputStream();
byte content[] = new byte[in.available()];
in.read(content, 0, content.length);
String receivedString = new String(content);
Log.d("Received String", receivedString)