为Curl类添加自定义头信息功能
This commit is contained in:
parent
2ca99a2de3
commit
beb002b648
|
@ -16,6 +16,8 @@ class Curl
|
|||
'verifyssl' => true,
|
||||
), $options);
|
||||
}
|
||||
|
||||
public $H;
|
||||
|
||||
/**
|
||||
* Send a request to the server, receive a response
|
||||
|
@ -69,6 +71,11 @@ class Curl
|
|||
} else {
|
||||
$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);
|
||||
|
||||
|
|
Loading…
Reference in New Issue