Class Headers

java.lang.Object
com.ibm.security.access.httpclient.Headers

public class Headers extends Object
This class stores the headers for a HTTP request.
  • Field Details

  • Constructor Details

    • Headers

      public Headers()
  • Method Details

    • addHeader

      public boolean addHeader(String name, List values)
      Add a header
      Parameters:
      name - Header name
      values - A List(String) of header values
      Returns:
      True if successful. False otherwise.
    • addHeader

      public boolean addHeader(String name, String value)
      Add a header
      Parameters:
      name - Header name
      value - Header value
      Returns:
      True if successful. False otherwise.
    • getHeaderNames

      public String[] getHeaderNames()
      Get all the header names. Returns null if there are no headers.
      Returns:
      Header names. Null if no headers.
    • getHeaders

      public Map getHeaders()
      Get all the headers
      Returns:
      A Map(String,List(String)) of all headers
    • getHeader

      public String[] getHeader(String name)
      Get the header values with the specified name. Returns null if no such header name or name was null/empty string.
      Parameters:
      name - The header name
      Returns:
      A List(String) of values associated with that header name. Null if no such header name exists or name was null/empty string.
    • removeHeader

      public boolean removeHeader(String name)
      Remove a header
      Parameters:
      name - Header name
      Returns:
      True if successful. False otherwise.