0
我用下面的代碼塊上捲曲發送數據:Kohana的捲曲發送的數據是空的
$content = $data['email'].'|'.$data['limit'].'|'.$data['docs'];
$curl = curl_init(ACCESS_URL);
curl_setopt($curl, CURLOPT_HEADER, false);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_POSTFIELDS, $content);
$answer = curl_exec($curl);
curl_close($curl);
WebService的側做運行,並創建該文件,但$ _ POST是空的。我無法弄清楚爲什麼。
public function action_getAccess() {
file_put_contents('/home/donut/uploads/data.txt', $_POST);
}
恰到好處! –