簡體   English   中英

Rest-ClickBank沙箱發布API不起作用

[英]Rest-ClickBank sandbox post api not working

我正在嘗試使用clickBank的Sandbox Api接受發布請求。 但是以某種方式它不起作用。

我正在使用POST方法調用clickBank的Prepare Api(https://sandbox.clickbank.com/rest/1.2/sandbox/prepare)。

但是它給了我這個錯誤HTTP / 1.1 405不允許的方法日期:2012年11月7日星期三12:08:32 GMT服務器:Apache / 2.2.22(FreeBSD)mod_jk / 1.2.32 mod_ssl / 2.2.22 OpenSSL / 0.9。 8q允許:POST,OPTIONS內容長度:1034內容類型:text / html; charset = utf-8 1

這是我的代碼。

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,"https://sandbox.clickbank.com/rest/1.2/sandbox/prepare");
curl_setopt($ch, CURLOPT_HEADER, true); 
curl_setopt($ch, CURLOPT_POST, true); 
curl_setopt($ch, CURLOPT_NOBODY, true);
//curl_setopt($ch,CURLOPT_RETURNTRANSFER,true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);

curl_setopt($ch, CURLOPT_HTTPHEADER, array("Accept: application/xml", "Authorization:". $dev_key .":" .$api_key ));
$result = curl_exec($ch);
curl_close($ch);
print $result;

我嘗試了一切,但似乎沒有用。 任何幫助將不勝感激。

提前致謝。

嘗試在curl_exec()之前添加它:

curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');

它對我有用,我希望它也對您有用。

嘗試這個 :

$ch = curl_init();

curl_setopt($ch, CURLOPT_URL, "https://sandbox.clickbank.com/rest/1.3/sandbox/prepare");

curl_setopt($ch, CURLOPT_HEADER, false);

curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);

curl_setopt($ch, CURLOPT_HTTPHEADER, array("Accept:application/json", "Authorization: >>>Your Clickbank Developer API Key from ClickBan->Settings->My Account<<<"));

curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');

$return = curl_exec($ch);

curl_close($ch);

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM