4
* This file is part of the Nette Framework (http://nette.org)
6
* Copyright (c) 2004 David Grudl (http://davidgrudl.com)
8
* For the full copyright and license information, please view
9
* the file license.txt that was distributed with this source code.
18
* IHttpResponse interface.
24
/** @var int cookie expiration: forever (23.1.2037) */
25
const PERMANENT = 2116333333;
27
/** @var int cookie expiration: until the browser is closed */
30
/** HTTP 1.1 response code */
33
S204_NO_CONTENT = 204,
34
S300_MULTIPLE_CHOICES = 300,
35
S301_MOVED_PERMANENTLY = 301,
39
S304_NOT_MODIFIED = 304,
40
S307_TEMPORARY_REDIRECT= 307,
41
S400_BAD_REQUEST = 400,
42
S401_UNAUTHORIZED = 401,
45
S405_METHOD_NOT_ALLOWED = 405,
47
S500_INTERNAL_SERVER_ERROR = 500,
48
S501_NOT_IMPLEMENTED = 501,
49
S503_SERVICE_UNAVAILABLE = 503;
52
* Sets HTTP response code.
56
function setCode($code);
59
* Returns HTTP response code.
65
* Sends a HTTP header and replaces a previous one.
66
* @param string header name
67
* @param string header value
70
function setHeader($name, $value);
74
* @param string header name
75
* @param string header value
78
function addHeader($name, $value);
81
* Sends a Content-type HTTP header.
82
* @param string mime-type
83
* @param string charset
86
function setContentType($type, $charset = NULL);
89
* Redirects to a new URL.
91
* @param int HTTP code
94
function redirect($url, $code = self::S302_FOUND);
97
* Sets the number of seconds before a page cached on a browser expires.
98
* @param mixed timestamp or number of seconds
101
function setExpiration($seconds);
104
* Checks if headers have been sent.
110
* Returns a list of headers to sent.
113
function getHeaders();
117
* @param string name of the cookie
118
* @param string value
119
* @param mixed expiration as unix timestamp or number of seconds; Value 0 means "until the browser is closed"
126
function setCookie($name, $value, $expire, $path = NULL, $domain = NULL, $secure = NULL, $httpOnly = NULL);
130
* @param string name of the cookie.
136
function deleteCookie($name, $path = NULL, $domain = NULL, $secure = NULL);