2015-08-30 15:01:12 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
require(__DIR__ . '/../bootstrap.php');
|
|
|
|
|
|
|
|
use \Httpful\Request;
|
|
|
|
|
|
|
|
// Get event details for a public event
|
|
|
|
$uri = "http://api.showclix.com/Event/8175";
|
|
|
|
$response = Request::get($uri)
|
|
|
|
->expectsType('json')
|
|
|
|
->sendIt();
|
|
|
|
|
|
|
|
// Print out the event details
|
|
|
|
echo "The event {$response->body->event} will take place on {$response->body->event_start}\n";
|
|
|
|
|
|
|
|
// Example overriding the default JSON handler with one that encodes the response as an array
|
2016-09-30 00:26:31 +02:00
|
|
|
\Httpful\Httpful::register(\Httpful\Mime::JSON, new \Httpful\Handlers\JsonHandler(['decode_as_array' => true]));
|
2015-08-30 15:01:12 +02:00
|
|
|
|
|
|
|
$response = Request::get($uri)
|
|
|
|
->expectsType('json')
|
|
|
|
->sendIt();
|
|
|
|
|
|
|
|
// Print out the event details
|
2016-09-30 00:26:31 +02:00
|
|
|
echo "The event {$response->body['event']} will take place on {$response->body['event_start']}\n";
|