protected function parseCurlOptions($config)
    {
        $options = array();
        $prefix = 'CURLOPT_';
        foreach ($config as $key => $value) {
            $constantName = $prefix . strtoupper($key);
            if (!defined($constantName)) {
                $messageTemplate  = "Invalid option '%s' in apicaller.config parameter. ";
                $messageTemplate .= "Use options (from the cURL section in the PHP manual) without prefix '%s'";
                $message = sprintf($messageTemplate, $key, $prefix);
                throw new \Exception($message);
            }
            $options[constant($constantName)] = $value;
        }

        return $options;
    }