diff options
Diffstat (limited to 'php-client/class.phpipam-api.php')
-rw-r--r-- | php-client/class.phpipam-api.php | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/php-client/class.phpipam-api.php b/php-client/class.phpipam-api.php index 686a16b..a668dd2 100644 --- a/php-client/class.phpipam-api.php +++ b/php-client/class.phpipam-api.php @@ -200,6 +200,12 @@ class phpipam_api_client { "message" => "" ); + /** + * Reponse headers + * + * @var array + */ + public $response_headers = array (); @@ -538,7 +544,7 @@ class phpipam_api_client { * @return void */ public function set_api_identifiers ($identifiers) { - $this->api_server_identifiers = false; // clear this to forget any previous settings + $this->api_server_identifiers = false; // clear this to forget any previous settings if(is_array($identifiers)) { if(sizeof($identifiers)>0 && !$this->api_encrypt) { // reset @@ -624,6 +630,8 @@ class phpipam_api_client { // save result $this->result = (array) $res; } + // save reult + $this->curl_save_headers (); } /** @@ -654,7 +662,9 @@ class phpipam_api_client { CURLOPT_USERAGENT => 'phpipam-api php class', // ssl CURLOPT_SSL_VERIFYHOST => false, - CURLOPT_SSL_VERIFYPEER => false + CURLOPT_SSL_VERIFYPEER => false, + // save headers + CURLINFO_HEADER_OUT => true ) ); } @@ -825,6 +835,17 @@ class phpipam_api_client { } /** + * Store result code + * + * @method curl_save_result_code + * @return void + */ + private function curl_save_headers () { + // save result and result code + $this->response_headers = curl_getinfo($this->Connection); + } + + /** * send authenticate request and save token if provided, otherwise throw error. * * @access private |