$data
$data : array|object
response data
A generic DataResponse class that is used to return generic data responses for responders to transform
It handles headers, HTTP status code, last modified and ETag.
$contentSecurityPolicy : \OCP\AppFramework\Http\ContentSecurityPolicy|null
addCookie(string $name, string $value, \DateTime|null $expireDate = null) : $this
Adds a new cookie to the response
string | $name | The name of the cookie |
string | $value | The value of the cookie |
\DateTime|null | $expireDate | Date on that the cookie should expire, if set to null cookie will be considered as session cookie. |
setStatus(integer $status) : \OCP\AppFramework\Http\Response
Set response status
integer | $status | a HTTP status code, see also the STATUS constants |
Reference to this object
setContentSecurityPolicy(\OCP\AppFramework\Http\ContentSecurityPolicy $csp) : $this
Set a Content-Security-Policy
\OCP\AppFramework\Http\ContentSecurityPolicy | $csp | Policy to set for the response object |
getContentSecurityPolicy() : \OCP\AppFramework\Http\ContentSecurityPolicy|null
Get the currently used Content-Security-Policy
Used Content-Security-Policy or null if none specified.
setETag(string $ETag) : \OCP\AppFramework\Http\Response
Set the ETag
string | $ETag |
Reference to this object
setLastModified(\DateTime $lastModified) : \OCP\AppFramework\Http\Response
Set "last modified" date
\DateTime | $lastModified |
Reference to this object
__construct(array|object $data = array(), integer $statusCode = \OCP\AppFramework\Http::STATUS_OK, array $headers = array())
array|object | $data | the object or array that should be transformed |
integer | $statusCode | the Http status code, defaults to 200 |
array | $headers | additional key value based headers |
setData(array|object $data) : \OCP\AppFramework\Http\DataResponse
Sets values in the data json array
array|object | $data | an array or object which will be transformed |
Reference to this object