Class Referer

All Implemented Interfaces:
Serializable, Cloneable, Header, NameValuePair

@Header("Referer") public class Referer extends BasicUriHeader
Represents a parsed Referer HTTP request header.

This is the address of the previous web page from which a link to the currently requested page was followed. (The word “referrer” has been misspelled in the RFC as well as in most implementations to the point that it has become standard usage and is considered correct terminology)

Example

Referer: http://en.wikipedia.org/wiki/Main_Page

RFC2616 Specification
The Referer[sic] request-header field allows the client to specify, for the server's benefit, the address (URI) of the resource from which the Request-URI was obtained (the "referrer", although the header field is misspelled.) The Referer request-header allows a server to generate lists of back-links to resources for interest, logging, optimized caching, etc. It also allows obsolete or mistyped links to be traced for maintenance. The Referer field MUST NOT be sent if the Request-URI was obtained from a source that does not have its own URI, such as input from the user keyboard.

Referer = "Referer" ":" ( absoluteURI | relativeURI )

Example:

Referer: http://www.w3.org/hypertext/DataSources/Overview.html

If the field value is a relative URI, it SHOULD be interpreted relative to the Request-URI. The URI MUST NOT include a fragment. See section 15.1.3 for security considerations.

See Also:
  • Constructor Details

    • Referer

      public Referer(String value)
      Constructor.
      Parameters:
      value - The header value.
      Must be parsable by URI.create(String).
      Can be null.
    • Referer

      public Referer(URI value)
      Constructor.
      Parameters:
      value - The header value.
      Can be null.
    • Referer

      public Referer(Supplier<URI> value)
      Constructor with delayed value.

      Header value is re-evaluated on each call to BasicUriHeader.getValue().

      Parameters:
      value - The supplier of the header value.
      Can be null.
  • Method Details

    • of

      public static Referer of(String value)
      Static creator.
      Parameters:
      value - The header value.
      Must be parsable by URI.create(String).
      Can be null.
      Returns:
      A new header bean, or null if the value is null.
    • of

      public static Referer of(URI value)
      Static creator.
      Parameters:
      value - The header value.
      Can be null.
      Returns:
      A new header bean, or null if the value is null.
    • of

      public static Referer of(Supplier<URI> value)
      Static creator with delayed value.

      Header value is re-evaluated on each call to BasicUriHeader.getValue().

      Parameters:
      value - The supplier of the header value.
      Can be null.
      Returns:
      A new header bean, or null if the value is null.