public function request($method, $endpoint, array $data = null, array $query = null, $rawData = false)
    {
        $options = ['json' => $data];

        if ($rawData) {
            $options = $data;
        }

        if (isset($query)) {
            $options['query'] = $query;
        }

        $url = $this->baseUrl . $endpoint;

        return $this->performRequest($method, $url, $options);
    }