2011-05-24 59 views
0

全部,cURL PHP代码为Facebook

目前我有一个Facebook页面,每隔几分钟使用cURL命令更新。该命令是:

curl.exe -kF "access_token=XXX" -F "message=YYY" https://graph.facebook.com/<appID>/feed

我如何编程实现在PHP中-k-F

[编辑-05/24日 - 15:59EST]:

-k标志:允许无证书(H)到SSL站点的连接
-F:-F/- 形式指定HTTP多部分POST数据(H)

我不确定messageaccess_token应该作为POST字段传递。任何人都可以请指导我呢?

我收到错误: {"error":{"type":"OAuthException","message":"(#803) Some of the aliases you requested do not exist: 1.8800586791358e 14" }}* Connection #0 to host graph.facebook.com left intact

+1

如果你确定他们的确做了什么,你可能会得到更多的答复 – 2011-05-24 17:33:11

+0

可能的重复:http://stackoverflow.com/questions/356705/how-to-send-a-header-using-a-http-request-通过卷曲 – Andre 2011-05-24 17:33:44

+2

这里是你如何使用curl在php http://us.php.net/manual/en/book.curl.php – Ibu 2011-05-24 17:34:36

回答

2

您需要使用的功能curl_setopt()
查看文档CURLOPT_SSL_VERIFYHOSTCURLOPT_POSTFIELDS

+0

感谢发布。你能帮我解决上面的错误吗? – 2011-05-24 21:11:50