Android 当我试图解析来自GooglePlacePhotoAPI的图像时,为什么会出现500内部服务器错误?
当我尝试从Android 当我试图解析来自GooglePlacePhotoAPI的图像时,为什么会出现500内部服务器错误?,android,api,http,google-api,Android,Api,Http,Google Api,当我尝试从HttpUrlConnection连接时,我得到一个等于500的ResponseCOde: try { urlConnection = (HttpURLConnection) url.openConnection(); urlConnection.setRequestMethod("GET"); urlConnection.connect(); if (urlConnection.ge
HttpUrlConnection
连接时,我得到一个等于500的ResponseCOde
:
try {
urlConnection = (HttpURLConnection) url.openConnection();
urlConnection.setRequestMethod("GET");
urlConnection.connect();
if (urlConnection.getResponseCode() == 200) {
Log.d("QueryUtils","connected");
inputStream = urlConnection.getInputStream();
Log.d("QueryUtils","input stream is ours");
jsonResponse = readFromStream(inputStream);
} else {
Log.e("MainActivity", "Error Response Code: " + urlConnection.getResponseCode());
}
请注意,我可以从web浏览器成功建立连接。。但在我的android应用程序中,我收到一个500内部服务器错误尝试记录你点击的url?我做到了。。这就是我要点击的url:您是否在请求API密钥的末尾添加了API密钥?我想这就是问题所在?当然我正在添加我的API密钥。。。但我不想在这里公开,我只想知道..问题是来自代码还是来自android studio(需要某种身份验证或许可)?