src/Api.php
protected function request($path, array $data = null, $method = null)
    {
        $authError = $this->authenticationError();
        if (null !== $authError) {
            return $authError;
        }

        $url  = 'https://api.cloudflare.com/client/v4/' . $path;
        $args = $this->prepareRequestArguments($data, $method);

        $response = wp_remote_request($url, $args);

        if (is_wp_error($response)) {
            return $response;
        }

        return $this->decode($response);
    }
protected function request($path, array $data = null, $method = null)
    {
        $authError = $this->authenticationError();
        if (null !== $authError) {
            return $authError;
        }

        $url  = 'https://api.cloudflare.com/client/v4/' . $path;
        $args = $this->prepareRequestArguments($data, $method);

        $response = wp_remote_request($url, $args);

        if (is_wp_error($response)) {
            return $response;
        }

        return $this->decode($response);
    }
protected function request ( $ path , array $ data = null , $ method = null ) { $ authError = $ this -> authenticationError ( ) ; if ( null !== $ authError ) { return $ authError ; } $ url = 'https://api.cloudflare.com/client/v4/' . $ path ; $ args = $ this -> prepareRequestArguments ( $ data , $ method ) ; $ response = wp_remote_request ( $ url , $ args ) ; if ( is_wp_error ( $ response ) ) { return $ response ; } return $ this -> decode ( $ response ) ; }
API call method for sending requests via wp_remote_request.

@param string      $path   Path of the endpoint.
@param array|null  $data   Data to be sent along with the request.
@param string|null $method Type of method that should be used ('GET', 'POST', 'PUT', 'DELETE', 'PATCH').

@return  array|WP_Error
API call method for sending requests via wp_remote_request .