( ′∀`)σ≡σ☆))Д′)レ(゚∀゚;)ヘ=З=З=Зε≡(ノ´_ゝ`)ノ
<?php
// Test API get_models response
$url = 'http://localhost/looksy/api/virtual_dress.php';
$data = ['action' => 'get_models'];
$options = [
'http' => [
'header' => "Content-type: application/x-www-form-urlencoded\r\n",
'method' => 'POST',
'content' => http_build_query($data)
]
];
$context = stream_context_create($options);
$result = file_get_contents($url, false, $context);
echo "Response from get_models:\n";
echo $result;
// Parse and check IDs
$json = json_decode($result, true);
if ($json && isset($json['models'])) {
echo "\n\nFirst model ID: " . $json['models'][0]['id'] . "\n";
echo "Type of ID: " . gettype($json['models'][0]['id']) . "\n";
}
?>