':type method: str
:type url: str
:type data: str | None
:type headers: dict[str, str] | None
:rtype: HttpResponse'

def request(self, method, url, data=None, headers=None):

    cmd = ['curl', '-s', '-S', '-i', '-X', method]
    if (headers is None):
        headers = {}
    headers['Expect'] = ''
    for header in headers.keys():
        cmd += ['-H', ('%s:    %s' % (header, headers[header]))]
    if (data is not None):
        cmd += ['-d', data]
    cmd += [url]
    (stdout, _) = run_command(self.args, cmd, capture=True, always=self.always, cmd_verbosity=2)
    if (self.args.explain and (not self.always)):
        return HttpResponse(method, url, 200, '')
    (header, body) = stdout.split('\r\n\r\n', 1)
    response_headers = header.split('\r\n')
    first_line = response_headers[0]
    http_response = first_line.split('    ')
    status_code = int(http_response[1])
    return HttpResponse(method, url, status_code, body)
