public static class Http.Headers
extends java.lang.Object
Constructor and Description |
---|
Headers(java.util.Map<java.lang.String,java.util.List<java.lang.String>> headers) |
Modifier and Type | Method and Description |
---|---|
Http.Headers |
addHeader(java.lang.String name,
java.util.List<java.lang.String> values)
Add a new header with the given values.
|
Http.Headers |
addHeader(java.lang.String name,
java.lang.String value)
Add a new header with the given value.
|
play.api.mvc.Headers |
asScala() |
boolean |
contains(java.lang.String headerName)
Checks if the given header is present.
|
java.util.Optional<java.lang.String> |
get(java.lang.String name)
Gets the header value.
|
java.util.List<java.lang.String> |
getAll(java.lang.String name)
Get all the values associated with the header name.
|
Http.Headers |
remove(java.lang.String name)
Remove a header.
|
java.util.Map<java.lang.String,java.util.List<java.lang.String>> |
toMap() |
public Headers(java.util.Map<java.lang.String,java.util.List<java.lang.String>> headers)
public java.util.Map<java.lang.String,java.util.List<java.lang.String>> toMap()
public boolean contains(java.lang.String headerName)
headerName
- The name of the header (case-insensitive)true
if the request did contain the header.public java.util.Optional<java.lang.String> get(java.lang.String name)
name
- the header namepublic java.util.List<java.lang.String> getAll(java.lang.String name)
name
- the header name.public play.api.mvc.Headers asScala()
public Http.Headers addHeader(java.lang.String name, java.lang.String value)
name
- the header namevalue
- the header valuepublic Http.Headers addHeader(java.lang.String name, java.util.List<java.lang.String> values)
name
- the header namevalues
- the header valuespublic Http.Headers remove(java.lang.String name)
name
- the header name.