protected function prepareHeaders()
    {
        // Need to let curl set the content type when posting. Our own content type
        // value would overwrite that.
        if ($this->method === HttpMethods::POST && !empty($this->headers["Content-Type"])) {
            unset($this->headers["Content-Type"]);
        }
        
        curl_setopt($this->curl, CURLOPT_USERAGENT, $this->userAgent);
        if (!empty($this->headers)) {
            $headers = $this->getHeadersBuilder()->normalize($this->headers);
            curl_setopt($this->curl, CURLOPT_HTTPHEADER, $headers);
        }
    }