curl Content-Type 值无法设定
短短的 2017-08-14 10:47:34 // generate the extra headers
$headers = array();
$headers[]='KEY: '.$key;
$headers[]='SIGN: '.$sign;
$headers[]='Content-Type:application/x-www-form-urlencoded;charset=utf-8';
//!!! please set Content-Type to application/x-www-form-urlencoded if it's not the default value
// curl handle (initialize if required)
static $ch = null;
if (is_null($ch)) {
$ch = curl_init();
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/4.0 (compatible; Bter PHP bot; '.php_uname('a').'; PHP/'.phpversion().')');
}
curl_setopt($ch, CURLOPT_URL, '/vv.php'.$path);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);
怎么还是叫我
please set Content-Type to application/x-www-form-urlencoded'