This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

Rewrite Curl to LUA?
#4
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
Reply


Messages In This Thread
Rewrite Curl to LUA? - by zoltan - 14.09.2017, 15:14
RE: Rewrite Curl to LUA? - by admin - 15.09.2017, 07:37
RE: Rewrite Curl to LUA? - by zoltan - 15.09.2017, 16:01
RE: Rewrite Curl to LUA? - by DGrandes - 21.08.2018, 08:38
RE: Rewrite Curl to LUA? - by admin - 21.08.2018, 12:06
RE: Rewrite Curl to LUA? - by DGrandes - 22.08.2018, 07:24

Forum Jump: