|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object play.mvc.Http.Response
public static class Http.Response
The HTTP response.
Field Summary |
---|
Fields inherited from interface play.mvc.Http.HeaderNames |
---|
ACCEPT, ACCEPT_CHARSET, ACCEPT_ENCODING, ACCEPT_LANGUAGE, ACCEPT_RANGES, AGE, ALLOW, AUTHORIZATION, CACHE_CONTROL, CONNECTION, CONTENT_ENCODING, CONTENT_LANGUAGE, CONTENT_LENGTH, CONTENT_LOCATION, CONTENT_MD5, CONTENT_RANGE, CONTENT_TRANSFER_ENCODING, CONTENT_TYPE, COOKIE, DATE, ETAG, EXPECT, EXPIRES, FROM, HOST, IF_MATCH, IF_MODIFIED_SINCE, IF_NONE_MATCH, IF_RANGE, IF_UNMODIFIED_SINCE, LAST_MODIFIED, LOCATION, MAX_FORWARDS, PRAGMA, PROXY_AUTHENTICATE, PROXY_AUTHORIZATION, RANGE, REFERER, RETRY_AFTER, SERVER, SET_COOKIE, SET_COOKIE2, TE, TRAILER, TRANSFER_ENCODING, UPGRADE, USER_AGENT, VARY, VIA, WARNING, WWW_AUTHENTICATE |
Constructor Summary | |
---|---|
Http.Response()
|
Method Summary | |
---|---|
java.lang.Iterable<Http.Cookie> |
cookies()
|
void |
discardCookies(java.lang.String... names)
Discard cookies along this result For example: |
java.lang.Iterable<java.lang.String> |
discardedCookies()
|
java.util.Map<java.lang.String,java.lang.String> |
getHeaders()
Gets the current response headers. |
void |
setContentType(java.lang.String contentType)
Sets the content-type of the response. |
void |
setCookie(java.lang.String name,
java.lang.String value)
Set a new transient cookie with path “/” For example: |
void |
setCookie(java.lang.String name,
java.lang.String value,
int maxAge)
Set a new cookie with path “/” |
void |
setCookie(java.lang.String name,
java.lang.String value,
int maxAge,
java.lang.String path)
Set a new cookie |
void |
setCookie(java.lang.String name,
java.lang.String value,
int maxAge,
java.lang.String path,
java.lang.String domain)
Set a new cookie |
void |
setCookie(java.lang.String name,
java.lang.String value,
int maxAge,
java.lang.String path,
java.lang.String domain,
boolean secure,
boolean httpOnly)
Set a new cookie |
void |
setHeader(java.lang.String name,
java.lang.String Stringue)
Adds a new header to the response. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Http.Response()
Method Detail |
---|
public void setHeader(java.lang.String name, java.lang.String Stringue)
public java.util.Map<java.lang.String,java.lang.String> getHeaders()
public void setContentType(java.lang.String contentType)
public void setCookie(java.lang.String name, java.lang.String value)
response().setCookie("theme", "blue");
name
- Cookie namevalue
- Cookie valuepublic void setCookie(java.lang.String name, java.lang.String value, int maxAge)
name
- Cookie namevalue
- Cookie valuemaxAge
- Cookie duration (-1 for a transient cookie and 0 for a cookie that expires now)public void setCookie(java.lang.String name, java.lang.String value, int maxAge, java.lang.String path)
name
- Cookie namevalue
- Cookie valuemaxAge
- Cookie duration (-1 for a transient cookie and 0 for a cookie that expires now)path
- Cookie pathpublic void setCookie(java.lang.String name, java.lang.String value, int maxAge, java.lang.String path, java.lang.String domain)
name
- Cookie namevalue
- Cookie valuemaxAge
- Cookie duration (-1 for a transient cookie and 0 for a cookie that expires now)path
- Cookie pathdomain
- Cookie domainpublic void setCookie(java.lang.String name, java.lang.String value, int maxAge, java.lang.String path, java.lang.String domain, boolean secure, boolean httpOnly)
name
- Cookie namevalue
- Cookie valuemaxAge
- Cookie duration (-1 for a transient cookie and 0 for a cookie that expires now)path
- Cookie pathdomain
- Cookie domainsecure
- Whether the cookie is secured (for HTTPS requests)httpOnly
- Whether the cookie is HTTP only (i.e. not accessible from client-side JavaScript code)public void discardCookies(java.lang.String... names)
response().discardCookies("theme");
names
- Names of the cookies to discardpublic java.lang.Iterable<Http.Cookie> cookies()
public java.lang.Iterable<java.lang.String> discardedCookies()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |