add:新增忽略ssl方法
This commit is contained in:
parent
9754a23360
commit
8991315888
@ -15,6 +15,7 @@ use think\Facade;
|
|||||||
* @method static \catcher\library\client\Http put(string $url)
|
* @method static \catcher\library\client\Http put(string $url)
|
||||||
* @method static \catcher\library\client\Http delete(string $url)
|
* @method static \catcher\library\client\Http delete(string $url)
|
||||||
* @method static \catcher\library\client\Http token(string $token)
|
* @method static \catcher\library\client\Http token(string $token)
|
||||||
|
* @method static \catcher\library\client\Http ignoreSsl()
|
||||||
* @method static \catcher\library\client\Http attach($name, $resource, $filename)
|
* @method static \catcher\library\client\Http attach($name, $resource, $filename)
|
||||||
*
|
*
|
||||||
* @time 2020年05月22日
|
* @time 2020年05月22日
|
||||||
|
@ -29,18 +29,39 @@ class Http
|
|||||||
*/
|
*/
|
||||||
protected $proxy = [];
|
protected $proxy = [];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* body
|
||||||
|
*
|
||||||
|
* @var array
|
||||||
|
*/
|
||||||
protected $body = [];
|
protected $body = [];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* header
|
||||||
|
*
|
||||||
|
* @var array
|
||||||
|
*/
|
||||||
protected $header = [];
|
protected $header = [];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* form params
|
||||||
|
*
|
||||||
|
* @var array
|
||||||
|
*/
|
||||||
protected $formParams = [];
|
protected $formParams = [];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* query set
|
||||||
|
*
|
||||||
|
* @var array
|
||||||
|
*/
|
||||||
protected $query = [];
|
protected $query = [];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* json set
|
||||||
|
*
|
||||||
|
* @var array
|
||||||
|
*/
|
||||||
protected $json = [];
|
protected $json = [];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -68,6 +89,14 @@ class Http
|
|||||||
protected $token = '';
|
protected $token = '';
|
||||||
|
|
||||||
protected $multipart = [];
|
protected $multipart = [];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 忽略证书
|
||||||
|
*
|
||||||
|
* @var array
|
||||||
|
*/
|
||||||
|
protected $ignoreSsl = [];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取 Guzzle 客户端
|
* 获取 Guzzle 客户端
|
||||||
*
|
*
|
||||||
@ -194,6 +223,20 @@ class Http
|
|||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 忽略 ssl 证书
|
||||||
|
*
|
||||||
|
* @return $this
|
||||||
|
*/
|
||||||
|
public function ignoreSsl()
|
||||||
|
{
|
||||||
|
$this->ignoreSsl = [
|
||||||
|
'verify' => false,
|
||||||
|
];
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 可选参数
|
* 可选参数
|
||||||
*
|
*
|
||||||
@ -265,7 +308,8 @@ class Http
|
|||||||
protected function merge()
|
protected function merge()
|
||||||
{
|
{
|
||||||
return array_merge($this->header, $this->query, $this->timeout,
|
return array_merge($this->header, $this->query, $this->timeout,
|
||||||
$this->options, $this->body, $this->auth, $this->multipart, $this->formParams
|
$this->options, $this->body, $this->auth, $this->multipart, $this->formParams,
|
||||||
|
$this->ignoreSsl
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user