Package play.mvc
Class Http.Headers
java.lang.Object
play.mvc.Http.Headers
- Enclosing class:
- Http
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionDeprecated.Deprecated as of 2.8.0.Deprecated.Deprecated as of 2.8.0.Add a new header with the given value.Add a new header with the given values.asMap()play.api.mvc.HeadersasScala()booleanChecks if the given header is present.Gets the header value.Get all the values associated with the header name.Deprecated.Deprecated as of 2.8.0.Remove a header.toMap()Deprecated.Deprecated as of 2.8.0.
-
Constructor Details
-
Headers
-
-
Method Details
-
toMap
Deprecated.Deprecated as of 2.8.0. UseasMap()instead.- Returns:
- all the headers as a map.
-
asMap
- Returns:
- all the headers as an unmodifiable map.
-
contains
Checks if the given header is present.- Parameters:
headerName- The name of the header (case-insensitive)- Returns:
trueif the request did contain the header.
-
get
Gets the header value. If more than one value is associated with this header, then returns the first one.- Parameters:
name- the header name- Returns:
- the first header value or empty if no value available.
-
getAll
Get all the values associated with the header name.- Parameters:
name- the header name.- Returns:
- the list of values associates with the header of empty.
-
asScala
public play.api.mvc.Headers asScala()- Returns:
- the scala version of this headers.
-
addHeader
Deprecated.Deprecated as of 2.8.0. Useadding(String, String)instead.Add a new header with the given value.- Parameters:
name- the header namevalue- the header value- Returns:
- this with the new header added
-
adding
Add a new header with the given value.- Parameters:
name- the header namevalue- the header value- Returns:
- a new Header instance with the new header added
-
addHeader
Deprecated.Deprecated as of 2.8.0. Useadding(String, List)instead.Add a new header with the given values.- Parameters:
name- the header namevalues- the header values- Returns:
- this with the new header added
-
adding
Add a new header with the given values.- Parameters:
name- the header namevalues- the header values- Returns:
- a new Header instance with the new header added
-
remove
Deprecated.Deprecated as of 2.8.0. Useremoving(String)instead.Remove a header.- Parameters:
name- the header name.- Returns:
- this without the removed header.
-
removing
Remove a header.- Parameters:
name- the header name.- Returns:
- a new Header instance without the removed header.
-