'Perform a REST request'

def request(self, path, payload=None):

    self.define_method()
    self.result['url'] = (('%(protocol)s://%(hostname)s/' % self.params) + path.lstrip('/'))
    (resp, info) = fetch_url(self.module, self.result['url'], data=payload, headers=self.headers, method=self.params['method'].upper(), timeout=self.params['timeout'], use_proxy=self.params['use_proxy'])
    self.result['response'] = info['msg']
    self.result['status'] = info['status']
    if (info['status'] != 200):
        try:
            aci_response_json(self.result, info['body'])
            self.module.fail_json(msg=('Request    failed:    %(error_code)s    %(error_text)s' % self.result), **self.result)
        except KeyError:
            self.module.fail_json(msg=('Request    failed    for    %(url)s.    %(msg)s' % info))
    aci_response_json(self.result, resp.read())
