21.08.2018, 08:38
Hi,
I´ve tried to traslate this code to LM with your example but something is wrong.
Can anyone help me?
Code:
<?php
// set variables
$queryUrl = "http://api.kairos.com/detect";
$imageObject = '{"image":"YOUR_IMAGE_URL"}';
$APP_ID = "YOUR_APP_ID";
$APP_KEY = "YOUR_APP_KEY";
$request = curl_init($queryUrl);
// set curl options
curl_setopt($request, CURLOPT_POST, true);
curl_setopt($request,CURLOPT_POSTFIELDS, $imageObject);
curl_setopt($request, CURLOPT_HTTPHEADER, array(
"Content-type: application/json",
"app_id:" . $APP_ID,
"app_key:" . $APP_KEY
)
);
curl_setopt($request, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($request);
// show the API response
echo $response;
// close the session
curl_close($request);
Thanks
I´ve tried to traslate this code to LM with your example but something is wrong.
Can anyone help me?
Code:
<?php
// set variables
$queryUrl = "http://api.kairos.com/detect";
$imageObject = '{"image":"YOUR_IMAGE_URL"}';
$APP_ID = "YOUR_APP_ID";
$APP_KEY = "YOUR_APP_KEY";
$request = curl_init($queryUrl);
// set curl options
curl_setopt($request, CURLOPT_POST, true);
curl_setopt($request,CURLOPT_POSTFIELDS, $imageObject);
curl_setopt($request, CURLOPT_HTTPHEADER, array(
"Content-type: application/json",
"app_id:" . $APP_ID,
"app_key:" . $APP_KEY
)
);
curl_setopt($request, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($request);
// show the API response
echo $response;
// close the session
curl_close($request);
Thanks