【发布时间】:2013-02-18 15:28:09
【问题描述】:
我正在使用 file_get_contents() 将信息发送到 facebook graph api
但有时我会收到错误消息。
我发现必须使用 cURL 而不是 file_get_contents()。
问题是,我不知道如何将 cURL 与我需要传递的 URL 一起使用。
如果我转换了
file_get_contents($graph_url);
进入cURL,代码是什么?
这里是 $graph_url 的内容
$graph_url= "https://graph.facebook.com/me/photos?"
. "url=" . urlencode($photo_url)
. "&message=" . urlencode('')
. "&method=POST"
. "&access_token=" .$access_token;
【问题讨论】:
-
阅读 cURL 文档,了解如何提出请求。
标签: php facebook-graph-api curl file-get-contents