host.$url,$params,$header,$timeout); } /** * 返回成功结果 * @param string $message * @param mixed $data * @return bool */ protected function success(string $message = 'success', $data = []) { $this->message = $message; $this->data = $data; return true; } /** * 返回失败结果 * @param string $message * @param mixed $data * @return bool */ protected function error(string $message = 'error', $data = []) { $this->message = $message; $this->data = $data; return false; } /** * 获取成功数据 * @return mixed */ public function getData() { return $this->data; } /** * 获取消息 * @return string */ public function getMessage() { return $this->message; } }