@@ -200,6 +200,12 @@ class phpipam_api_client {
200200 "message " => ""
201201 );
202202
203+ /**
204+ * Reponse headers
205+ *
206+ * @var array
207+ */
208+ public $ response_headers = array ();
203209
204210
205211
@@ -538,7 +544,7 @@ public function set_api_controller ($controller = false) {
538544 * @return void
539545 */
540546 public function set_api_identifiers ($ identifiers ) {
541- $ this ->api_server_identifiers = false ; // clear this to forget any previous settings
547+ $ this ->api_server_identifiers = false ; // clear this to forget any previous settings
542548 if (is_array ($ identifiers )) {
543549 if (sizeof ($ identifiers )>0 && !$ this ->api_encrypt ) {
544550 // reset
@@ -624,6 +630,8 @@ public function execute ($method = false, $controller = false, $identifiers = ar
624630 // save result
625631 $ this ->result = (array ) $ res ;
626632 }
633+ // save reult
634+ $ this ->curl_save_headers ();
627635 }
628636
629637 /**
@@ -654,7 +662,9 @@ private function curl_set_connection ($token_file) {
654662 CURLOPT_USERAGENT => 'phpipam-api php class ' ,
655663 // ssl
656664 CURLOPT_SSL_VERIFYHOST => false ,
657- CURLOPT_SSL_VERIFYPEER => false
665+ CURLOPT_SSL_VERIFYPEER => false ,
666+ // save headers
667+ CURLINFO_HEADER_OUT => true
658668 )
659669 );
660670 }
@@ -824,6 +834,17 @@ private function curl_execute () {
824834 }
825835 }
826836
837+ /**
838+ * Store result code
839+ *
840+ * @method curl_save_result_code
841+ * @return void
842+ */
843+ private function curl_save_headers () {
844+ // save result and result code
845+ $ this ->response_headers = curl_getinfo ($ this ->Connection );
846+ }
847+
827848 /**
828849 * send authenticate request and save token if provided, otherwise throw error.
829850 *
0 commit comments