mirror of
https://github.com/nextcloud/documentation.git
synced 2026-01-03 18:26:42 +07:00
add document for NotFoundResponse and ForbiddenResponse
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
ForbiddenResponse
|
||||
=================
|
||||
|
||||
|
||||
Returns 403 Forbidden status to user.
|
||||
|
||||
This Class renders response with HTTP/1.1 403 Forbidden header and empty
|
||||
content. If you want to return specified content, please extend it with your
|
||||
own class.
|
||||
|
||||
|
||||
.. php:namespace:: OCA\AppFramework\Http
|
||||
.. php:class:: ForbiddenResponse
|
||||
|
||||
|
||||
|
||||
.. php:method:: __construct()
|
||||
|
||||
Creates a response that returns HTTP 403 Forbidden status.
|
||||
@@ -0,0 +1,19 @@
|
||||
NotFoundResponse
|
||||
================
|
||||
|
||||
|
||||
Returns 404 Not Found status to user.
|
||||
|
||||
This Class renders response with HTTP/1.1 404 Not Found header and empty
|
||||
content. If you want to return specified content, please extend it with your
|
||||
own class.
|
||||
|
||||
|
||||
.. php:namespace:: OCA\AppFramework\Http
|
||||
.. php:class:: NotFoundResponse
|
||||
|
||||
|
||||
|
||||
.. php:method:: __construct()
|
||||
|
||||
Creates a response that returns HTTP 404 Not Found status.
|
||||
@@ -22,6 +22,8 @@ AppFramework API
|
||||
http_textdownloadresponse
|
||||
http_twigresponse
|
||||
http_request
|
||||
http_notfoundresponse
|
||||
http_forbiddenresponse
|
||||
middleware_middleware
|
||||
middleware_middlewaredispatcher
|
||||
middleware_security_securitymiddleware
|
||||
@@ -82,4 +84,4 @@ Twig Templates
|
||||
|
||||
Testing
|
||||
-------
|
||||
* :doc:`utility_controllertestutility`
|
||||
* :doc:`utility_controllertestutility`
|
||||
|
||||
@@ -70,6 +70,10 @@ Every controller method has to return a Response object. The currently available
|
||||
* :php:class:`OCA\\AppFramework\\Http\\TextDownloadResponse`: prompts the user to download a text file containing a passed string
|
||||
* :php:class:`OCA\\AppFramework\\Http\\TextResponse`: for printing text like XML
|
||||
|
||||
.. versionchanged:: 6.0
|
||||
|
||||
* :php:class:`OCA\\AppFramework\\Http\\ForbiddenResponse`: returns 403 Forbidden HTTP status
|
||||
* :php:class:`OCA\\AppFramework\\Http\\NotFoundResponse`: returns 404 Not Found HTTP status
|
||||
|
||||
Should you require to set additional headers, you can use the :php:meth:`OCA\\AppFramework\\Http\\Response::addHeader` method that every Response has.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user