开发者

Post request using CURL [duplicate]

This question already has answers here: Closed 11 years ago. 开发者_如何学编程

Possible Duplicate:

Post data and retrieve the response using PHP Curl?

I want to make a number of POST requests (about 1000) to read data from a webpage which accepts post requests.I am aware about the implementing CURL through GET, but not through POST. So, please help me in this.

Thanks in advance...:)


Did you look at the documentation? Basically, just do a curl_setopt()

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


I agree with everyone else, quick search through the docs would have helped you here.

Heres an explination I found on how to do it http://davidwalsh.name/execute-http-post-php-curl


You'll want to use curl_setopt to set the CURLOPT_POST option to TRUE like this:

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

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜