古詩詞大全網 - 經典古詩 - 請教壹個PHP CURL的POST提交遇到的問題

請教壹個PHP CURL的POST提交遇到的問題

給妳壹個思路,使用/webapi/list.create.json');

curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);

curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);

curl_setopt($ch, CURLOPT_AUTOREFERER, 1);

curl_setopt($ch, CURLOPT_POST, 1);

curl_setopt($ch, CURLOPT_HEADER, 0);

curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);

$data = array(

'api_user' => '*',

'api_key' => '*',

'address' => 'runnerlee@maillist.sendcloud.org',

'name' => 'Abao新建的測試郵件列表',

'description' => '這是Abao新建的測試郵件列表',

);

curl_setopt($ch,CURLOPT_POSTFIELDS, http_build_query($data));

if(false === $result=curl_exec($ch)) {

echo 'false:<br />';

}

var_dump(json_decode($result,true));

curl_close($ch);