4d / docs

Products Documentation
Creative Commons Attribution 4.0 International
6 stars 19 forks source link

Comment on REST/$imageformat.md (19) #311

Open gaetanarinfo opened 8 months ago

gaetanarinfo commented 8 months ago

Bonjour,

Est-til possible d'afficher l'image car actuellement il retourne array(1) { ["ok"]=> bool(true) }

Technologie utilisé PHP

env('LOCMAT_URL') // ip local

$url = 'http://' . env('LOCMAT_URL') . '/rest/Articles(652)/ImageCAB?$imageformat=best&$version=2&$expand=ImageCAB';

$curl = curl_init();

curl_setopt_array($curl, array( CURLOPT_URL => $url, CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => '', CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 0, CURLOPT_FOLLOWLOCATION => true, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => 'GET', CURLOPT_HTTPHEADER => array( 'username-4D: SQL', 'password-4D: LocmatSQL', 'session-4D-length: 60', 'Cookie: 4DSID_Locmatv18=' . $_COOKIE['4DSID_Locmatv18'] . ';WASID4D=' . $_COOKIE['WASID4D'] ), ));

$response = curl_exec($curl);

curl_close($curl);

$decodedData = json_decode($response, JSON_PRETTY_PRINT);

$data3 = $decodedData;

var_dump($data3);

Merci pour votre réponse