Package org.apache.juneau.http.header
Class Location
java.lang.Object
org.apache.juneau.http.header.BasicHeader
org.apache.juneau.http.header.BasicUriHeader
org.apache.juneau.http.header.Location
- All Implemented Interfaces:
Serializable
,Cloneable
,Header
,NameValuePair
Represents a parsed Location HTTP response header.
Used in redirection, or when a new resource has been created.
Example
Location: http://www.w3.org/pub/WWW/People.html
RFC2616 Specification
The Location response-header field is used to redirect the recipient to a location other than the Request-URI for completion of the request or identification of a new resource. For 201 (Created) responses, the Location is that of the new resource which was created by the request. For 3xx responses, the location SHOULD indicate the server's preferred URI for automatic redirection to the resource. The field value consists of a single absolute URI.Location = "Location" ":" absoluteURI
An example is:
Location: http://www.w3.org/pub/WWW/People.html
Note: The Content-Location header field (section 14.14) differs from Location in that the Content-Location identifies the original location of the entity enclosed in the request. It is therefore possible for a response to contain header fields for both Location and Content-Location. Also see section 13.10 for cache requirements of some methods.
See Also:
-
Constructor Summary
-
Method Summary
Methods inherited from class org.apache.juneau.http.header.BasicUriHeader
asUri, getValue, of, of, of, orElse, toUri
Methods inherited from class org.apache.juneau.http.header.BasicHeader
assertName, assertStringValue, asString, equals, equalsIgnoreCase, get, getElements, getName, hashCode, isNotEmpty, isPresent, of, of, orElse, toString
-
Constructor Details
-
Location
Constructor.- Parameters:
value
- The header value.
Must be parsable byURI.create(String)
.
Can benull .
-
Location
Constructor.- Parameters:
value
- The header value.
Can benull .
-
Location
Constructor with delayed value.Header value is re-evaluated on each call to
BasicUriHeader.getValue()
.- Parameters:
value
- The supplier of the header value.
Can benull .
-
-
Method Details
-
of
Static creator.- Parameters:
value
- The header value.
Must be parsable byURI.create(String)
.
Can benull .- Returns:
- A new header bean, or
null if the value isnull .
-
of
Static creator.- Parameters:
value
- The header value.
Can benull .- Returns:
- A new header bean, or
null if the value isnull .
-
of
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 benull .- Returns:
- A new header bean, or
null if the value isnull .
-