【问题标题】:Post request using CURL [duplicate]使用 CURL 发布请求 [重复]
【发布时间】:2011-09-05 20:51:08
【问题描述】:

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

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

提前谢谢...:)

【问题讨论】:

    标签: php ajax post curl


    【解决方案1】:

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

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

    【讨论】:

      【解决方案2】:

      我同意其他所有人的观点,在这里快速搜索文档会对您有所帮助。

      这是我找到的关于如何做到这一点的说明http://davidwalsh.name/execute-http-post-php-curl

      【讨论】:

        【解决方案3】:

        您需要使用 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
        

        【讨论】:

          猜你喜欢
          • 2015-02-16
          • 1970-01-01
          • 2020-02-29
          • 1970-01-01
          • 2015-12-06
          • 2022-11-29
          • 2012-12-28
          • 2017-11-14
          • 2016-04-15
          相关资源
          最近更新 更多