<body>
<?php 
require_once 'test-util.php';
require_once dirname(__FILE__) . '/../lib/ca-main.php';
echo '<div class="apitest">';
echo '<h1>users_processes_notes_index</h1>';
$ca = new CityApi();
$ca->debug = true;
$ca->json = true;
echo "<h2>Test:</h2>";
$userid = 238801;
$processid = 12343;
$results = $ca->users_processes_notes_index($userid, $processid, array('page' => 1));
echo "<h2>results:</h2>{$results}";
echo '<h2>Formatted JSON results: </h2>';
echo '<pre>';
echo format_json($results);
echo '</pre>';
echo '<h2>HTTP Response Info</h2>';
echo '<pre>';
var_dump($ca->get_last_status_code());
var_dump($ca->get_last_response_start_line());
var_dump($ca->get_last_headers());
echo '</pre>';
echo '</div>';
?>

</body>

</html>
require_once 'test-util.php';
require_once dirname(__FILE__) . '/../lib/ca-main.php';
try {
    if ($_POST['formSubmit'] == "Submit") {
        $verb = $_POST['formVerb'];
        $url = $_POST['formURL'];
        $body = $_POST['formJSONBody'];
        $ca = new CityApi();
        $ca->debug = true;
        $results = $ca->call_city($verb, $url, $body);
        echo "<h1>{$verb}{$url}{$body}</h1>";
        echo '<h2>Results</h2>';
        echo '<h3>HTTP Status</h3>';
        echo $ca->get_last_status_code();
        echo '<h3>HTTP Response Start Line</h3>';
        echo $ca->get_last_response_start_line();
        echo '<h3>HTTP Headers</h3>';
        var_dump($ca->get_last_headers());
        echo '<h3>City Results</h3>';
        echo $results;
        echo '<pre>';
        echo format_json($results);
        echo '</pre>';
    }
} catch (Exception $e) {
    echo '<h3>Exception</h3>';
    echo '<pre>';
    echo $e->getMessage();
    echo '</pre>';
}
?>