我第一次在yii应用程序中使用curl。
以下是我的代码
$ch = curl_init();
$u='admin';
$p='admin123';
$postvars = '';
foreach($string as $key=>$value) {
$postvars .= $key . "/" . $value . "/";
}
curl_setopt($ch, CURLOPT_URL, 'http://localhost:83/Working-copy/tradiecom/ServiceTypeMaster/Create' );
curl_setopt($ch, CURLOPT_USERPWD, $u.':'.$p);
curl_setopt($ch, CURLOPT_FORBID_REUSE, false);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, count($string));
curl_setopt($ch, CURLOPT_POSTFIELDS, $postvars);
$json = curl_exec($ch);
if ($json === false)
{
echo 'test';
}
print_r($json);
现在我不知道如何在ServiceTypeMaster / create action中访问post变量? 而且我不知道我的行动是否被召唤? 我怎么知道呢。