capsucleCRM API ColdFusion包装器
正在寻找用于CapsucleCRM的以下PHP API包装的ColdFusion版本:capsucleCRM API ColdFusion包装器,api,coldfusion,wrapper,Api,Coldfusion,Wrapper,正在寻找用于CapsucleCRM的以下PHP API包装的ColdFusion版本: <?php // The data you want to send to Capsule CRM in xml format // SEE http://capsulecrm.com/help/page/javelin_api_party “curl\u setopt\u array”函数的具体功能是什么?是否有CF等价物 // set appropriate options NB these a
<?php
// The data you want to send to Capsule CRM in xml format
// SEE http://capsulecrm.com/help/page/javelin_api_party
“curl\u setopt\u array”函数的具体功能是什么?是否有CF等价物
// set appropriate options NB these are the minimum necessary to achieve a post with a useful response
// ...can and should add more in a real application such as
// timeout CURLOPT_CONNECTTIMEOUT
// and useragent CURLOPT_USERAGENT
// replace 1234567890123456789 with your own API token from your user preferences page
$options = array(CURLOPT_USERPWD => '1234567890123456789:x',
CURLOPT_HTTPHEADER => array('Content-Type: text/xml'),
CURLOPT_HEADER => true,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POST => true,
CURLOPT_POSTFIELDS => $myxml
);
curl_setopt_array($ch, $options);
// Do the POST and collect the response for future printing etc then close the session
$response = curl_exec($ch);
$responseInfo = curl_getinfo($ch);
curl_close($ch);
?>
我可能错了,但这看起来像是一个基本的http帖子。CF中的等效项为。要传递参数/头(即
curl\u setopt\u array
),请使用 我可能错了,但这看起来像是一个基本的http帖子。CF中的等价物是cfhttp
。要传递参数/头,请参见cfhttpparam
。
// Initialise the session and return a cURL handle to pass to other cURL functions.
$ch = curl_init($capsulepage);
// set appropriate options NB these are the minimum necessary to achieve a post with a useful response
// ...can and should add more in a real application such as
// timeout CURLOPT_CONNECTTIMEOUT
// and useragent CURLOPT_USERAGENT
// replace 1234567890123456789 with your own API token from your user preferences page
$options = array(CURLOPT_USERPWD => '1234567890123456789:x',
CURLOPT_HTTPHEADER => array('Content-Type: text/xml'),
CURLOPT_HEADER => true,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POST => true,
CURLOPT_POSTFIELDS => $myxml
);
curl_setopt_array($ch, $options);
// Do the POST and collect the response for future printing etc then close the session
$response = curl_exec($ch);
$responseInfo = curl_getinfo($ch);
curl_close($ch);
?>