优化 http 客户端
This commit is contained in:
@@ -34,6 +34,17 @@ class Response implements \ArrayAccess
|
||||
return $this->response->getBody();
|
||||
}
|
||||
|
||||
/**
|
||||
* 响应内容
|
||||
*
|
||||
* @time 2020年05月22日
|
||||
* @return false|string
|
||||
*/
|
||||
public function contents()
|
||||
{
|
||||
return $this->body()->getContents();
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @time 2020年05月21日
|
||||
@@ -41,7 +52,7 @@ class Response implements \ArrayAccess
|
||||
*/
|
||||
public function json():array
|
||||
{
|
||||
return \json_decode($this->response->getBody()->getContents(), true);
|
||||
return \json_decode($this->contents(), true);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user