使用CURL发布请求

时间:2011-05-31 22:45:53

标签: php ajax post curl

  

可能重复:
  Post data and retrieve the response using PHP Curl?

我想发一些POST请求(大约1000)来从接受post请求的网页读取数据。我知道通过GET实现CURL,但不是通过POST。所以,请帮助我。

提前致谢... :)

3 个答案:

答案 0 :(得分:5)

你看过documentation了吗?基本上,只需要执行curl_setopt()

$ch = curl_init();
curl_setopt($ch, CURLOPT_POST);

答案 1 :(得分:1)

我同意其他人的意见,通过文档快速搜索会帮助你。

这是我发现如何做到这一点的探索http://davidwalsh.name/execute-http-post-php-curl

答案 2 :(得分:0)

您需要使用curl_setopt将CURLOPT_POST选项设置为TRUE,如下所示:

$curl_request = curl_init('http://path/to/url');
curl_setopt($curl_request, CURLOPT_POST, TRUE);
// Finish setting options and make the request
相关问题