<?php
use Laminas\Http\Client;
$client = new Client('http://php.budgegeria.de/result.json');
try {
$response = $client->send();
if ($response->isOk()) {
$body = $response->getBody();
// returns HAL json
dump(json_decode($body, true));
}
}
catch (Exception $e) {
// in case of connection problems
echo $e->getMessage();
}
^ array:4 [ "currentlyProcessing" => 14 "shippedToday" => 20 "_links" => array:3 [ "self" => array:1 [ "href" => "/result.json" ] "next" => array:1 [ "href" => "/result.json?page=2" ] "find" => array:2 [ "href" => "/result.json{?id}" "templated" => "true" ] ] "_embedded" => array:1 [ "orders" => array:1 [ 0 => array:4 [ "total" => 30 "currency" => "EUR" "status" => "shipped" "_links" => array:1 [ "self" => array:1 [ "href" => "/result.json/815" ] ] ] ] ] ]