Package org.htmlparser.http
Class HttpHeader
java.lang.Object
org.htmlparser.http.HttpHeader
Utility methods to display HTTP headers.
-
Method Summary
Modifier and TypeMethodDescriptionstatic String
getRequestHeader
(HttpURLConnection connection) Gets the request header for the connection.static String
Gets the response header for the connection.
-
Method Details
-
getRequestHeader
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
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.
-