0

我正在尝试使用 clickbank 的沙盒 api 的准备方法。

我的代码

       $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);`enter code here`
       curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
       curl_setopt($ch, CURLOPT_HTTPHEADER, array("Accept: application/xml","Authorization:DEV-  9B0D426BC6C70C4618F37D41B7E01877E731:API-D34454EDE1D2D8F45A62588CBF1DDC6B29B2"));

       $result = curl_exec($ch);
       curl_close($ch);

      print $result;
   ?>

但它给了我这个错误

“HTTP/1.1 500 内部服务器错误日期:2012 年 6 月 15 日星期五 11:30:18 GMT 服务器:Apache/2.2.22 (FreeBSD) mod_jk/1.2.32 mod_ssl/2.2.22 OpenSSL/0.9.8q 内容长​​度: 409 连接:关闭内容类型:文本/html 内部服务器错误 1"

我尝试了很多其他方法,但它总是给我 404 或 403 或 500 http 错误。

4

1 回答 1

0

尝试这个:

$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: DEV-9B0D426BC6C70C4618F37D41B7E01877E731"));

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

$return = curl_exec($ch);

curl_close($ch);
于 2013-04-15T05:12:59.537 回答