All Implemented Interfaces:
HttpMessage, HttpResponse
Direct Known Subclasses:
Found.Unmodifiable

Represents an HTTP 302 Found response.

Tells the client to look at (browse to) another url. 302 has been superseded by 303 and 307. This is an example of industry practice contradicting the standard. The HTTP/1.0 specification (RFC 1945) required the client to perform a temporary redirect (the original describing phrase was "Moved Temporarily"), but popular browsers implemented 302 with the functionality of a 303 See Other. Therefore, HTTP/1.1 added status codes 303 and 307 to distinguish between the two behaviours. However, some Web applications and frameworks use the 302 status code as if it were the 303.

See Also:
  • Field Details

  • Constructor Details

    • Found

      public Found()
      Constructor.
    • Found

      public Found(Found copyFrom)
      Copy constructor.
      Parameters:
      copyFrom - The bean to copy from. Must not be null.
    • Found

      public Found(HttpResponse response)
      Constructor.

      This is the constructor used when parsing an HTTP response.

      Parameters:
      response - The HTTP response to copy from. Must not be null.
      Throws:
      IllegalArgumentException - If HTTP response status code does not match what was expected.
  • Method Details

    • copy

      public Found copy()
      Creates a builder for this class initialized with the contents of this bean.
      Returns:
      A new builder bean.
    • unmodifiable

      public Found unmodifiable()
      Description copied from class: BasicHttpResponse
      Returns an unmodifiable snapshot of this bean.

      The returned instance is a point-in-time copy of the leaf's nested Unmodifiable type; any attempt to set a property on it throws an UnsupportedOperationException. This method is idempotent: if this bean is already unmodifiable it returns itself rather than taking another snapshot. The receiver is left unchanged (and still modifiable unless it was already unmodifiable).

      Specified by:
      unmodifiable in class BasicHttpResponse<Found>
      Returns:
      An unmodifiable snapshot of this bean, or this bean if it is already unmodifiable.