2010-11-24 55 views

回答

2

下面是一个使用PHP的卷曲发送POST数据为例:

<? 

$ch = curl_init(); 

$data = array('var1' => 'Foo', 'var2' => 'Bar'); 

curl_setopt($ch, CURLOPT_URL, 'http://localhost/'); 
curl_setopt($ch, CURLOPT_POST, 1); 
curl_setopt($ch, CURLOPT_POSTFIELDS, $data); 

curl_exec($ch); 
?> 

可以在the PHP documentation找到卷曲的更多信息。