Commit 79ff4a50 authored by Pedro Monjo's avatar Pedro Monjo
Browse files

Getting data in JSON format is not pretty-printed by default

parent c7d028a8
......@@ -292,10 +292,10 @@ class Target {
return $this->response;
}
/**
/**
* Get the last request to Target in JSON format
*/
public function getRequestJSON($pretty = true) {
public function getRequestJSON($pretty = false) {
$flags = $pretty ? JSON_PRETTY_PRINT : 0;
return json_encode($this->request,$flags);
}
......@@ -303,7 +303,7 @@ class Target {
/**
* Get the last response to the Target API invokation, in JSON format
*/
public function getResponseJSON($pretty = true) {
public function getResponseJSON($pretty = false) {
$flags = $pretty ? JSON_PRETTY_PRINT : 0;
return json_encode($this->response,$flags);
}
......
......@@ -66,8 +66,8 @@ try {
$target->setURL($url);
$target->setATProperty($at_property);
$target->execute(null);
echo "Target request: " . $target->getRequestJSON() . "\n";
echo "Target response: " . $target->getResponseJSON() . "\n";
echo "Target request: " . $target->getRequestJSON(true) . "\n";
echo "Target response: " . $target->getResponseJSON(true) . "\n";
/* Analytics tests */
/* echo "*** Analytics TESTS ***\n";
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment