client = new Client([ "base_uri" => "http://localhost:8080", ]); } /** * @param array $options */ public function request(string $method, string $path, array $options = []): Response { return $this->client->request( $method, $path, ["http_errors" => false] + $options ); } public function hasJsonBody(Response $response): bool { json_decode((string)$response->getBody()); return json_last_error() === JSON_ERROR_NONE; } }