I am trying to send a GET via Android's HttpURLConnection
(imported from org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnection
), and upon receiving the response, an IOException is thrown:
in doRequestInternal(): "Received authentication challenge is null"
What does this error mean, and what is causing this? I am writing OAuth parameters to the Authorization header, but I do this on other occasions, too, without problems.
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
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…