为Curl类添加自定义头信息功能
This commit is contained in:
parent
2ca99a2de3
commit
beb002b648
|
@ -17,6 +17,8 @@ class Curl
|
||||||
), $options);
|
), $options);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public $H;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Send a request to the server, receive a response
|
* Send a request to the server, receive a response
|
||||||
*
|
*
|
||||||
|
@ -70,6 +72,11 @@ class Curl
|
||||||
$headers[] = 'Content-Length: 0';
|
$headers[] = 'Content-Length: 0';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(!empty($this->H) && is_array($this->H) && count($this->H) > 0)
|
||||||
|
{
|
||||||
|
$headers = array_merge($headers,$this->H);
|
||||||
|
}
|
||||||
|
|
||||||
$this->debug('send '.$httpMethod.' request: '.$url);
|
$this->debug('send '.$httpMethod.' request: '.$url);
|
||||||
|
|
||||||
$curlOptions += array(
|
$curlOptions += array(
|
||||||
|
|
Loading…
Reference in New Issue