public function da_request(string $method, string $uri = '', array $options = []): array
    {
        $this->lastRequest = microtime(true);
        
        try {
            $response = $this->request($method, $uri, $options);
        }
        catch(\Exception $e) {
            
            if($e instanceof RequestException) {
                throw new DirectAdminRequestException(sprintf('DirectAdmin %s %s request failed.', $method, $uri));
            }
            
            if($e instanceof TransferException) {
                throw new DirectAdminTransferException(sprintf('DirectAdmin %s %s transfer failed.', $method, $uri));
            }
        }
        
        if($response->getHeader('Content-Type')[0] === 'text/html') {
            throw new DirectAdminBadContentException(sprintf('DirectAdmin %s %s returned text/html.', $method, $uri));
        }

        $body = $response->getBody()->getContents();

        return $this->responseToArray($body);
    }
public function da_request(string $method, string $uri = '', array $options = []): array
    {
        $this->lastRequest = microtime(true);
        
        try {
            $response = $this->request($method, $uri, $options);
        }
        catch(\Exception $e) {
            
            if($e instanceof RequestException) {
                throw new DirectAdminRequestException(sprintf('DirectAdmin %s %s request failed.', $method, $uri));
            }
            
            if($e instanceof TransferException) {
                throw new DirectAdminTransferException(sprintf('DirectAdmin %s %s transfer failed.', $method, $uri));
            }
        }
        
        if($response->getHeader('Content-Type')[0] === 'text/html') {
            throw new DirectAdminBadContentException(sprintf('DirectAdmin %s %s returned text/html.', $method, $uri));
        }

        $body = $response->getBody()->getContents();

        return $this->responseToArray($body);
    }
public function da_request ( string $ method , string $ uri = '' , array $ options = [ ] ) : array { $ this -> lastRequest = microtime ( true ) ; try { $ response = $ this -> request ( $ method , $ uri , $ options ) ; } catch ( \ Exception $ e ) { if ( $ e instanceof RequestException ) { throw new DirectAdminRequestException ( sprintf ( 'DirectAdmin %s %s request failed.' , $ method , $ uri ) ) ; } if ( $ e instanceof TransferException ) { throw new DirectAdminTransferException ( sprintf ( 'DirectAdmin %s %s transfer failed.' , $ method , $ uri ) ) ; } } if ( $ response -> getHeader ( 'Content-Type' ) [ 0 ] === 'text/html' ) { throw new DirectAdminBadContentException ( sprintf ( 'DirectAdmin %s %s returned text/html.' , $ method , $ uri ) ) ; } $ body = $ response -> getBody ( ) -> getContents ( ) ; return $ this -> responseToArray ( $ body ) ; }
DirectAdmin request to Server.

@param string $method    Method.
@param string $uri       Request URL.
@param array $options    Additional options.

@return mixed
DirectAdmin request to Server .