这是卷曲的帖子还是得到的?

时间:2014-04-25 12:24:00

标签: php curl

我有一个PHP代码:

$url='https://payment.testingfc.com/TokenPayment.jsp?merchantId='. $merchantid .'&data='.$desEncryptedData; 

$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($curl, CURLOPT_FOLLOWLOCATION, 1);
$auth = curl_exec($curl);

这是卷曲POST还是GET?

2 个答案:

答案 0 :(得分:2)

除非你指定POST ..它是GET。

答案 1 :(得分:0)

你可以这样做一个POST:

<?php

$post_data = array('merchantId'=>$merchantid, 'data'=>$desEncryptedData);

$curl = curl_init('https://payment.testingfc.com/TokenPayment.jsp');

curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($curl, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($curl, CURLOPT_POST, 1);
curl_setopt($curl, CURLOPT_POSTFIELDS, $post_data);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, TRUE);

$result = curl_exec($curl);

?>