HTML Parser Home Page

org.htmlparser.http
Class HttpHeader

java.lang.Object
  extended by org.htmlparser.http.HttpHeader

public class HttpHeader
extends Object

Utility methods to display HTTP headers.


Method Summary
static String getRequestHeader(HttpURLConnection connection)
          Gets the request header for the connection.
static String getResponseHeader(HttpURLConnection conn)
          Gets the response header for the connection.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getRequestHeader

public static String getRequestHeader(HttpURLConnection connection)
Gets the request header for the connection. This header is generated from the contents of the connection and may not be exactly the same as the request that will be sent.

Parameters:
connection - The connection to convert into an HTTP request header.
Returns:
The string that would be sent by the HTTP request.

getResponseHeader

public static String getResponseHeader(HttpURLConnection conn)
Gets the response header for the connection. Calling this method on an un-connected connection will generate an error, as will an attempt to get information from a connected but invalid connection. This header is generated from the contents of the connection and may not be exactly the same as the response that was received.

Parameters:
conn - The connection to convert into an HTTP response header.
Returns:
The string that was sent as the HTTP response.

© 2006 Derrick Oswald
Sep 17, 2006

HTML Parser is an open source library released under Common Public License. SourceForge.net