Headers

public class Headers

The Headers class represents the headers of an HTTP URL connection or of the HTTP servlet request and response.

Author:Hugo Y. K. Lam

Constructors

Headers

public Headers(HttpURLConnection connection)

Creates a new instance of Headers.

Parameters:
  • connection – the HTTP connection for getting or setting the headers.

Headers

public Headers(HttpServletRequest request, HttpServletResponse response)

Creates a new instance of Headers.

Parameters:
  • request – the servlet request for getting the headers.
  • response – the servlet response for setting the headers.

Methods

getInputStreamHeaders

public InputStream getInputStreamHeaders()

Gets the headers as an input stream from the underlying request object.

Returns:an input stream of the headers.

getInternetHeaders

public InternetHeaders getInternetHeaders()

Gets the Internet headers from the underlying request object.

Returns:the Internet headers.

getMimeHeaders

public MimeHeaders getMimeHeaders()

Gets the mime headers from the underlying request object.

Returns:the mime headers.

putInternetHeaders

public void putInternetHeaders(InternetHeaders headers)

Puts the Internet headers into the underlying response object.

Parameters:
  • headers – the Internet headers.

putMimeHeaders

public void putMimeHeaders(MimeHeaders headers)

Puts the mime headers into the underlying response object.

Parameters:
  • headers – the mime headers.