Class Headers


  • public class Headers
    extends java.lang.Object
    This class stores the headers for a HTTP request.
    • Constructor Summary

      Constructors 
      Constructor Description
      Headers()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean addHeader​(java.lang.String name, java.lang.String value)
      Add a header
      boolean addHeader​(java.lang.String name, java.util.List values)
      Add a header
      java.lang.String[] getHeader​(java.lang.String name)
      Get the header values with the specified name.
      java.lang.String[] getHeaderNames()
      Get all the header names.
      java.util.Map getHeaders()
      Get all the headers
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • Headers_java_sourceCodeID

        public static final java.lang.String Headers_java_sourceCodeID
        See Also:
        Constant Field Values
      • Headers_java_copyright

        public static final java.lang.String Headers_java_copyright
    • Constructor Detail

      • Headers

        public Headers()
    • Method Detail

      • addHeader

        public boolean addHeader​(java.lang.String name,
                                 java.util.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​(java.lang.String name,
                                 java.lang.String value)
        Add a header
        Parameters:
        name - Header name
        value - Header value
        Returns:
        True if successful. False otherwise.
      • getHeaderNames

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

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

        public java.lang.String[] getHeader​(java.lang.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.