04-20-2022, 11:16 AM
(This post was last modified: 04-20-2022, 11:17 AM by staff@ergosoft.it.)
Hi,
I need to connect a application (delphi 11) with API web service of bindcommerce (https://www.bindcommerce.com/it/guide/ap...t-prodotti)
this is an examples in php of autentication:
<?php
ini_set('display_errors', true);
error_reporting(E_ALL);
$strXml = file_get_contents(__DIR__.'/Products.xml');
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://miohost.bindcommerce.cloud/integrator-tool/api/products.php?connector=N",
CURLOPT_SSL_VERIFYPEER => 0,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_VERBOSE => true,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => $strXml,
CURLOPT_HTTPHEADER => array(
"cache-control: no-cache",
"content-type: text/xml",
"token: 0435a03b361d7cc24fc1acacdeaae1d7"
),
));
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
How in delphi ?
thanks
I need to connect a application (delphi 11) with API web service of bindcommerce (https://www.bindcommerce.com/it/guide/ap...t-prodotti)
this is an examples in php of autentication:
<?php
ini_set('display_errors', true);
error_reporting(E_ALL);
$strXml = file_get_contents(__DIR__.'/Products.xml');
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://miohost.bindcommerce.cloud/integrator-tool/api/products.php?connector=N",
CURLOPT_SSL_VERIFYPEER => 0,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_VERBOSE => true,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => $strXml,
CURLOPT_HTTPHEADER => array(
"cache-control: no-cache",
"content-type: text/xml",
"token: 0435a03b361d7cc24fc1acacdeaae1d7"
),
));
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
How in delphi ?
thanks