diff options
author | Lukas Reschke <lukas@owncloud.com> | 2015-03-16 11:28:23 +0100 |
---|---|---|
committer | Lukas Reschke <lukas@owncloud.com> | 2015-03-25 16:04:41 +0100 |
commit | 5f044ebf1bc6f45acec2e79dc05185acd0405f42 (patch) | |
tree | 8bc8797ef55588d3aab1b160acb3e2f5576d460f /lib/private/http/client/response.php | |
parent | 13904a7f8979a87492ac765e05017eb1e4b69588 (diff) | |
download | nextcloud-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.php | 58 |
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(); + } +} |