Print http headers. Useful for debugging.
import java.net.MalformedURLException; import java.net.URL; import org.apache.http.Header; class Utilities { /** * Print http headers. Useful for debugging. * * @param headers */ public static String getHeadersAsString(Header[] headers) { StringBuffer s = new StringBuffer("Headers:"); s.append("------------"); for (Header h : headers) s.append(h.toString()); s.append("------------"); return s.toString(); } }