【发布时间】:2010-11-24 08:23:25
【问题描述】:
我正在尝试通过 Android 的 HttpURLConnection(从 org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnection 导入)发送 GET,并且在收到响应后,IOException strong> 被抛出:
在 doRequestInternal() 中:“收到的身份验证质询为空”
这个错误是什么意思,是什么原因造成的?我正在将 OAuth 参数写入 Authorization 标头,但我在其他场合也这样做,没有问题。
if (connection == null) {
connection = (HttpURLConnection) new URL(endpointUrl).openConnection();
connection.setRequestMethod("GET");
}
//... do some OAuth message signing
connection.connect();
int statusCode = connection.getResponseCode(); // throws IOException
【问题讨论】:
标签: java android httpurlconnection