Skip to content

Commit

Permalink
add test call
Browse files Browse the repository at this point in the history
  • Loading branch information
nadar committed Jan 15, 2018
1 parent 3f7843b commit 1dbae7d
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions test.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?php

use Curl\Curl;

require_once 'vendor/autoload.php';

$url = isset($argv[1]) ? $argv[1] : false;

if (!$url) {
echo "You have to provide an url, example: php test.php http://localhost/luya-envs-dev/public_html/errorapi/create";
exit(1);
}

$curl = new Curl();
$curl->post($url, ['error_json' => json_encode([
'serverName' => 'foo',
'message' => 'fooo',
'trace' => [
1 => ['message' => 'Yes', 'array' => [1,2,3]],
2 => 'boom',
],
'integer' => 1,
'boolena' => false,
'foobar' => [123,123],
])]);

var_dump($curl->response);

0 comments on commit 1dbae7d

Please sign in to comment.