diff options
Diffstat (limited to 'lib/response/formresponse.php')
| -rw-r--r-- | lib/response/formresponse.php | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/lib/response/formresponse.php b/lib/response/formresponse.php new file mode 100644 index 0000000..e7ce33d --- /dev/null +++ b/lib/response/formresponse.php @@ -0,0 +1,20 @@ +<?php +namespace OCA\Grauphel\Lib\Response; + +class FormResponse extends \OCP\AppFramework\Http\Response +{ + protected $data; + + public function __construct($data) + { + $this->setStatus(\OCP\AppFramework\Http::STATUS_OK); + $this->addHeader('Content-Type', 'application/x-www-form-urlencoded'); + $this->data = $data; + } + + public function render() + { + return http_build_query($this->data, null, '&'); + } +} +?> |
