Can';我不能让这个内容旋转API与PHP一起工作

Can';我不能让这个内容旋转API与PHP一起工作,php,api,spinner,Php,Api,Spinner,你能帮我把它修好吗?它是为了与C一起工作而编写的,但是有没有一种方法可以让它使用PHP来工作呢?我一直在尝试使用cURL发布到该页面上声明的URL,但我得到的只是一个空白页面。以下是我使用的代码: $url = "http://api.spinnerchief.com/apikey=YourAPIKey&username=YourUsername&password=YourPassword"; // Some content to POST $post_fields = "Sp

你能帮我把它修好吗?它是为了与C一起工作而编写的,但是有没有一种方法可以让它使用PHP来工作呢?我一直在尝试使用cURL发布到该页面上声明的URL,但我得到的只是一个空白页面。以下是我使用的代码:

$url = "http://api.spinnerchief.com/apikey=YourAPIKey&username=YourUsername&password=YourPassword";

// Some content to POST
$post_fields = "SpinnerChief is totally free. Not a 'lite' or 'trial' version, but a 100% full version and totally free. SpinnerChief may be free, but it is also one of the most powerful content creation software tools available. It's huge user-defined thesaurus means that its sysnonyms are words that YOU would normally use in real life, not some stuffy dictionary definition. And there's more...SpinnerChief can only get better, because we listen to our users, We take onboard your ideas and suggestions, and we update SpinnerChief so that it becomes the software YOU want!";

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_PORT, 9001);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $post_fields);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
curl_close($ch);

echo $result;

有人看到我做错了什么吗?非常感谢您的帮助。

CURLOPT_POST的值应该是
1
,发布的数据应该设置为
CURLOPT_POSTFIELDS

您是否用有效的数据替换了'YourAPIKey'等?是的:)它只会返回一个空白页面。当您浏览到URL(完全绕过PHP脚本)时会得到什么?URL有效吗?相同。空白页。可能是因为没有文本得到“后置”,这导致了空白页。我不确定。我已经试用了C#应用程序并查看了代码。它使用这个“wb.UploadString(mStr,“POST”,textBox1.Text);”来发送文本。也许我不清楚。当您使用适当的凭证浏览到“”,而不是
yourAPIKey
YourUsername
YourPassword
,您会得到什么?是的,也尝试过了。仍然不返回任何内容(如果发布正确,它至少应该返回一个错误或什么,但它没有。哦,是的。它返回“无法连接到主机”。但是该站点是活动的。您是否
urlencode
-ing URL参数(键、用户名、密码)?参数中的特殊字符可能会破坏URL。不,我没有,但它们不包含任何特殊字符。我将它们直接粘贴到URL字符串中。是否端口9001被阻止导致无法连接?这是可能的。您可以使用浏览器检查这一点,即尝试以
http://api.spinnerchief.com:9001/…