aboutsummaryrefslogtreecommitdiff
path: root/php-client/example.php
diff options
context:
space:
mode:
authorGravatar Miha Petkovsek <miha.petkovsek@gmail.com> 2016-11-23 18:23:27 +0100
committerGravatar Miha Petkovsek <miha.petkovsek@gmail.com> 2016-11-23 18:23:27 +0100
commit989c13160c781b9bf419cd84c0a9760e1c4e2b05 (patch)
tree70d2539bde716a323fd1819e1995339f931af680 /php-client/example.php
parent234d3667b356f192243fa019b993b65391b05469 (diff)
downloadphpipam-api-clients-989c13160c781b9bf419cd84c0a9760e1c4e2b05.tar.gz
Added response headers to API->response_headers
Diffstat (limited to 'php-client/example.php')
-rw-r--r--php-client/example.php21
1 files changed, 14 insertions, 7 deletions
diff --git a/php-client/example.php b/php-client/example.php
index 9d3eb9e..483da00 100644
--- a/php-client/example.php
+++ b/php-client/example.php
@@ -16,15 +16,22 @@ $API = new phpipam_api_client ($api_url, $api_app_id, $api_key, $api_username, $
# debug - only to debug curl
$API->set_debug (true);
# execute - result is stored to $API->result, save it to own array if multiple calls needed after execute
-
-$API->execute ("POST", "addresses", array("first_free", "7"), array(), $token_file);
-
-
-// $API->execute ("DELETE", "subnets", array(7, "permissions"), array(), $token_file);
-// $API->execute ("POST", "vrf", array(), array("number"=>"114","name"=>"API"), $token_file);
-# ger result
+$API->execute ("GET", "addresses", array("first_free", "7"), array(), $token_file);
+# get result
$result = $API->get_result();
+/**
+ * Some examples
+ *
+ * Delete, POST examples
+ * $API->execute ("DELETE", "subnets", array(7, "permissions"), array(), $token_file);
+ * $API->execute ("POST", "vrf", array(), array("number"=>"114","name"=>"API"), $token_file);
+ *
+ * Get headers in array
+ * $response_headers = $API->response_headers ();
+ */
+
# print result
+print_r($response_headers);
print_r(json_decode($result, true));
?>