使用curl发布参数是错误的,而使用php Yii';s卷曲可以

使用curl发布参数是错误的,而使用php Yii';s卷曲可以,curl,Curl,下面的代码是php使用YII框架发布参数 public static$\u host=”http://example.com'; 私有静态$_id=123; 私有静态$_密钥='432543253'; 公共$\u客户; 公营部门$params ;; 函数_u构造(){ $this->initizlize(); } 公共函数初始化(){ $this->_client=new RESTClient(); $config=array( “服务器”=>self::$\u主机 ); $this->par

下面的代码是php使用YII框架发布参数

public static$\u host=”http://example.com';
私有静态$_id=123;
私有静态$_密钥='432543253';
公共$\u客户;
公营部门$params ;;
函数_u构造(){
$this->initizlize();
}
公共函数初始化(){
$this->_client=new RESTClient();
$config=array(
“服务器”=>self::$\u主机
);
$this->params=array(
'id'=>self::$\u id,
'key'=>self::$\u键
);
$this->_client->initialize($config);
}
公共函数geList($date=null){
$uri='file/list';
$date=$date?$date:date('Y-m-d');
$this->params['date']=$date;
$result=$this->_client->post($uri,$this->params);
返回$this->parseResult($result);

}
我已使用

curl-i-H'charset=UTF-8'-F'date=2017-04-05'-F'key=432543253'-F'id=123'-X POST”http://example.com“