我正在请求以下请求,并且我在 android 应用程序中遇到异常。
URL url = new URL(strURL);
URLConnection urlConnection = url.openConnection();
try {
HttpURLConnection httpConn = (HttpURLConnection) urlConnection;
httpConn.setRequestMethod("GET");
httpConn.connect();
if (httpConn.getResponseCode() == HttpURLConnection.HTTP_OK) {
is = httpConn.getInputStream();
}
} catch (Exception ex) {
System.out.println(ex);
}
得到以下异常
java.net.SocketException: Permission denied