summaryrefslogtreecommitdiffstats
path: root/php_http_client/client.php
diff options
context:
space:
mode:
authormbernier <matt.bernier@sendgrid.com>2016-02-29 22:17:49 -0700
committermbernier <matt.bernier@sendgrid.com>2016-02-29 22:17:49 -0700
commit4351d77ad0de1bfa695ab09bc7c772a9e09c9d23 (patch)
tree7715950b1ae4395995282bdd210de9a9aaa51fbe /php_http_client/client.php
parent9ccf626cbb53da486224feab51502f7f8949406a (diff)
downloadphp-http-client-4351d77ad0de1bfa695ab09bc7c772a9e09c9d23.zip
php-http-client-4351d77ad0de1bfa695ab09bc7c772a9e09c9d23.tar.gz
php-http-client-4351d77ad0de1bfa695ab09bc7c772a9e09c9d23.tar.bz2
Updated client and added ISSUE_TEMPLATE
Diffstat (limited to 'php_http_client/client.php')
-rw-r--r--php_http_client/client.php19
1 files changed, 9 insertions, 10 deletions
diff --git a/php_http_client/client.php b/php_http_client/client.php
index a70e084..34775c9 100644
--- a/php_http_client/client.php
+++ b/php_http_client/client.php
@@ -1,7 +1,7 @@
<?php
class Client {
- function __construct($host, $request_headers= [], $version=null){
+ function __construct($host, $request_headers = [], $version = null){
/*
@param host: Base URL for the api. (e.g. https://api.sendgrid.com)
@type host: string
@@ -20,20 +20,19 @@ class Client {
# _count and _url_path keep track of the dynamically built url
$this->_count = 0;
$this->_methods = ['delete', 'get', 'patch', 'post', 'put'];
- $this->_url_path = {};
- $this->_status_code = null;
- $this->_response_body = null;
- $this->_response_headers = null;
- $this->_response = null;
+
+ $this->_reset();
}
/*
Resets the URL builder, so you can make a fresh new dynamic call.
*/
- private function _reset(self) {
- $this->_count = 0
- $this->_url_path = {}
- $this->_response = None
+ private function _reset() {
+ $this->_count = 0;
+ $this->_url_path = [];
+ $this->_response = null;
+ $this->_response_body = null;
+ $this->_response_headers = null;
}
/**