Я делаю HttpUrlConnection
в приложении для Android с 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)