client = new Client([ 'base_uri' => C('TASK_URL'), 'timeout' => 5.0, ]); } public function post($uri, $data) { $response = $this->client->post($uri, [ 'verify' => false, 'form_params' => $data ]); $result = (string)$response->getBody(); return json_decode($result, true); } }