<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def sendRequest(self, extraHeaders=""):
 """ Sends a request to the URL specified and returns a response only if the HTTP code returned is OK :param extraHeaders: Allows to configure additional headers in the request :return: Response object set to None if there is an error """


        self.addParam('src', 'mc-python')

        params = urlencode(self._params)

        url = self._url

        if 'doc' in self._file.keys():
            headers = {}

            if (extraHeaders is not None) and (extraHeaders is dict):
                headers = headers.update(extraHeaders)

            result = requests.post(url=url, data=self._params, files=self._file, headers=headers)
            result.encoding = 'utf-8'
            return result
        else:
            headers = {'Content-Type': 'application/x-www-form-urlencoded'}
            if (extraHeaders is not None) and (extraHeaders is dict):
                headers = headers.update(extraHeaders)
            result = requests.request("POST", url=url, data=params, headers=headers)
            result.encoding = 'utf-8'
            return result