From db2f09d46ce2f3a46be1b6f6e031492966242025 Mon Sep 17 00:00:00 2001 From: Christian Weiske Date: Mon, 18 Aug 2014 23:54:32 +0200 Subject: oauth dance works --- lib/response/errorresponse.php | 20 ++++++++++++++++++++ lib/response/formresponse.php | 20 ++++++++++++++++++++ 2 files changed, 40 insertions(+) create mode 100644 lib/response/errorresponse.php create mode 100644 lib/response/formresponse.php (limited to 'lib/response') diff --git a/lib/response/errorresponse.php b/lib/response/errorresponse.php new file mode 100644 index 0000000..b72224f --- /dev/null +++ b/lib/response/errorresponse.php @@ -0,0 +1,20 @@ +setStatus(\OCP\AppFramework\Http::STATUS_BAD_REQUEST); + $this->addHeader('Content-Type', 'text/plain; charset=utf-8'); + $this->error = $error; + } + + public function render() + { + return $this->error . "\n"; + } +} +?> 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 @@ +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, '&'); + } +} +?> -- cgit v1.2.3