@@ -200,6 +200,12 @@ class phpipam_api_client {
200
200
"message " => ""
201
201
);
202
202
203
+ /**
204
+ * Reponse headers
205
+ *
206
+ * @var array
207
+ */
208
+ public $ response_headers = array ();
203
209
204
210
205
211
@@ -538,7 +544,7 @@ public function set_api_controller ($controller = false) {
538
544
* @return void
539
545
*/
540
546
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
542
548
if (is_array ($ identifiers )) {
543
549
if (sizeof ($ identifiers )>0 && !$ this ->api_encrypt ) {
544
550
// reset
@@ -624,6 +630,8 @@ public function execute ($method = false, $controller = false, $identifiers = ar
624
630
// save result
625
631
$ this ->result = (array ) $ res ;
626
632
}
633
+ // save reult
634
+ $ this ->curl_save_headers ();
627
635
}
628
636
629
637
/**
@@ -654,7 +662,9 @@ private function curl_set_connection ($token_file) {
654
662
CURLOPT_USERAGENT => 'phpipam-api php class ' ,
655
663
// ssl
656
664
CURLOPT_SSL_VERIFYHOST => false ,
657
- CURLOPT_SSL_VERIFYPEER => false
665
+ CURLOPT_SSL_VERIFYPEER => false ,
666
+ // save headers
667
+ CURLINFO_HEADER_OUT => true
658
668
)
659
669
);
660
670
}
@@ -824,6 +834,17 @@ private function curl_execute () {
824
834
}
825
835
}
826
836
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
+
827
848
/**
828
849
* send authenticate request and save token if provided, otherwise throw error.
829
850
*
0 commit comments