aboutsummaryrefslogtreecommitdiff
path: root/lib/response/formresponse.php
blob: e7ce33d3ab22f01a6cd8f64b8363670308739a14 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
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, '&');
    }
}
?>