Header (HttpClient Library (Version 3.1))
Date: 2019-09-02

org.apache.commons.httpclient

## Class Header

- java.lang.Object
- - org.apache.commons.httpclient.NameValuePair
  - - org.apache.commons.httpclient.Header

- All Implemented Interfaces:
    java.io.Serializable

      public class Header
      extends NameValuePair

  An HTTP header.

  Version:
    $Revision: 480424 $ $Date: 2006-11-29 06:56:49 +0100 (Wed, 29 Nov 2006) $
  Author:
    Remy Maucherat, Mike Bowler, Oleg Kalnichevski
  See Also:
    Serialized Form

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `Header()` Default constructor.
    `Header(java.lang.String name, java.lang.String value)` Constructor with name and value
    `Header(java.lang.String name, java.lang.String value, boolean isAutogenerated)` Constructor with name and value

  - ### Method Summary

    All Methods Instance Methods Concrete Methods Deprecated Methods
    Modifier and Type | Method and Description
    --- | ---
    `HeaderElement[]` | `getElements()` Returns an array of `HeaderElement`s constructed from my value.
    `HeaderElement[]` | `getValues()` Deprecated. Use #getElements
    `boolean` | `isAutogenerated()` Returns the value of the auto-generated header flag.
    `java.lang.String` | `toExternalForm()` Returns a `String` representation of the header.
    `java.lang.String` | `toString()` Returns a `String` representation of the header.

    - ### Methods inherited from class org.apache.commons.httpclient.NameValuePair

      `equals, getName, getValue, hashCode, setName, setValue`

    - ### Methods inherited from class java.lang.Object

      `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### Header

          public Header()

      Default constructor.

    - #### Header

          public Header(java.lang.String name,
                        java.lang.String value)

      Constructor with name and value
      Parameters:
        `name` - the header name
        `value` - the header value

    - #### Header

          public Header(java.lang.String name,
                        java.lang.String value,
                        boolean isAutogenerated)

      Constructor with name and value
      Parameters:
        `name` - the header name
        `value` - the header value
        `isAutogenerated` - `true` if the header is autogenerated, `false` otherwise.
      Since:
        3.0

  - ### Method Detail

    - #### toExternalForm

          public java.lang.String toExternalForm()

      Returns a `String` representation of the header.
      Returns:
        stringHEAD

    - #### toString

          public java.lang.String toString()

      Returns a `String` representation of the header.
      Overrides:
        `toString` in class `NameValuePair`
      Returns:
        stringHEAD

    - #### getValues

          public HeaderElement[] getValues()
                                    throws HttpException

      Deprecated. Use #getElements
      Returns an array of `HeaderElement`s constructed from my value.
      Returns:
        an array of header elements
      Throws:
        `HttpException` - if the header cannot be parsed
      See Also:
        `HeaderElement.parse(java.lang.String)`

    - #### getElements

          public HeaderElement[] getElements()

      Returns an array of `HeaderElement`s constructed from my value.
      Returns:
        an array of header elements
      Since:
        3.0
      See Also:
        `HeaderElement.parseElements(String)`

    - #### isAutogenerated

          public boolean isAutogenerated()

      Returns the value of the auto-generated header flag.
      Returns:
        `true` if the header is autogenerated, `false` otherwise.
      Since:
        3.0

Copyright (c) 1999-2005 - Apache Software Foundation