// now let's add all the parameters into the header element
if (paramlist.size() > 0) {
NameValuePair[] tmp2 = new NameValuePair[paramlist.size()];
paramlist.copyInto((NameValuePair[]) tmp2);
element.parameters = tmp2;
paramlist.removeAllElements();
}
// and save the header element into the list of header elements
elements.addElement(element);
}