def request(self, path, query=None, method="GET", headers=None, body=None, auth=None):
        req = Request(self.abs_url(path, query))
        req.method = method
        if headers is None:
            headers = {}

        for name, value in headers.iteritems():
            req.add_header(name, value)

        if body is not None:
            req.add_data(body)

        if auth is not None:
            req.add_header("Authorization", "Basic %s" % base64.encodestring('%s:%s' % auth))

        return urllib2.urlopen(req)
dataset/ETHPy150Open w3c/wptserve/tests/functional/base.py/TestUsingServer.request/original