summaryrefslogtreecommitdiffstats
path: root/lib/private/http/client/response.php
diff options
context:
space:
mode:
authorLukas Reschke <lukas@owncloud.com>2015-03-16 11:28:23 +0100
committerLukas Reschke <lukas@owncloud.com>2015-03-25 16:04:41 +0100
commit5f044ebf1bc6f45acec2e79dc05185acd0405f42 (patch)
tree8bc8797ef55588d3aab1b160acb3e2f5576d460f /lib/private/http/client/response.php
parent13904a7f8979a87492ac765e05017eb1e4b69588 (diff)
downloadnextcloud-server-5f044ebf1bc6f45acec2e79dc05185acd0405f42.tar.gz
nextcloud-server-5f044ebf1bc6f45acec2e79dc05185acd0405f42.zip
Add wrapper for Guzzle
Diffstat (limited to 'lib/private/http/client/response.php')
-rw-r--r--lib/private/http/client/response.php58
1 files changed, 58 insertions, 0 deletions
diff --git a/lib/private/http/client/response.php b/lib/private/http/client/response.php
new file mode 100644
index 00000000000..54b7a93543c
--- /dev/null
+++ b/lib/private/http/client/response.php
@@ -0,0 +1,58 @@
+<?php
+/**
+ * Copyright (c) 2015 Lukas Reschke <lukas@owncloud.com>
+ * This file is licensed under the Affero General Public License version 3 or
+ * later.
+ * See the COPYING-README file.
+ */
+
+namespace OC\Http\Client;
+
+use OCP\Http\Client\IResponse;
+use GuzzleHttp\Message\Response as GuzzleResponse;
+
+/**
+ * Class Response
+ *
+ * @package OC\Http
+ */
+class Response implements IResponse {
+ /** @var GuzzleResponse */
+ private $response;
+
+ /**
+ * @param GuzzleResponse $response
+ */
+ public function __construct(GuzzleResponse $response) {
+ $this->response = $response;
+ }
+
+ /**
+ * @return string
+ */
+ public function getBody() {
+ return $this->response->getBody()->getContents();
+ }
+
+ /**
+ * @return int
+ */
+ public function getStatusCode() {
+ return $this->response->getStatusCode();
+ }
+
+ /**
+ * @param $key
+ * @return string
+ */
+ public function getHeader($key) {
+ return $this->response->getHeader($key);
+ }
+
+ /**
+ * @return array
+ */
+ public function getHeaders() {
+ return $this->response->getHeaders();
+ }
+}