// headerManager was set, so let's set the connection
// to use it.
HeaderManager mngr = getHeaderManager();
int headerSize = mngr.size();
for (int idx = 0; idx < headerSize; idx++) {
Header hd = mngr.getHeader(idx);
if (HEADER_CONTENT_LENGTH.equalsIgnoreCase(hd.getName())) {// Use this to override file length
length = Integer.parseInt(hd.getValue());
}
// All the other headers are set up by HTTPSampler2.setupConnection()
}
} else {
// otherwise we use "text/xml" as the default