responseCode = responseFromServer.getResponseCode();
log("Response:");
log("https StatusCode:" + String.valueOf(responseCode));
Response response = new Response();
List<HTTPHeader> resposeHeaderList = responseFromServer
.getHeaders();
Header header = new Header();
if (resposeHeaderList != null) {
for (HTTPHeader httpHeader : resposeHeaderList) {
if (httpHeader.getName().equals("Content-Type")) {
header.setName(httpHeader.getName());
header.setValue(httpHeader.getValue());
break;
}
}
}
response.setResponseAsString(EncodingUtil.getString(
responseFromServer.getContent(), getContentCharSet(header)));
log(response.toString() + "\n");
if (responseCode != OK)
{
log(response.asString());
try {
throw new WeiboException(getCause(responseCode),
response.asJSONObject(), responseCode);
} catch (JSONException e) {
e.printStackTrace();
}
}
return response;