}
}
log("final URL:"+request.getURL().toString());
HTTPResponse responseFromServer = service.fetch(request);
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)
{