def make_request(reactor, method, path, content=b'', access_token=None, request=SynapseRequest, shorthand=True):
    '\n    Make a web request using the given method and path, feed it the\n    content, and return the Request and the Channel underneath.\n\n    Args:\n        method (bytes/unicode): The HTTP request method ("verb").\n        path (bytes/unicode): The HTTP path, suitably URL encoded (e.g.\n        escaped UTF-8 & spaces and such).\n        content (bytes or dict): The body of the request. JSON-encoded, if\n        a dict.\n        shorthand: Whether to try and be helpful and prefix the given URL\n        with the usual REST API path, if it doesn\'t contain it.\n\n    Returns:\n        A synapse.http.site.SynapseRequest.\n    '
    if (not isinstance(method, bytes)):
        method = method.encode('ascii')
    if (not isinstance(path, bytes)):
        path = path.encode('ascii')
    if (shorthand and (not path.startswith(b'/_matrix'))):
        path = (b'/_matrix/client/r0/' + path)
        path = path.replace(b'//', b'/')
    if isinstance(content, text_type):
        content = content.encode('utf8')
    site = FakeSite()
    channel = FakeChannel(reactor)
    req = request(site, channel)
    req.process = (lambda : b'')
    req.content = BytesIO(content)
    if access_token:
        req.requestHeaders.addRawHeader(b'Authorization', (b'Bearer ' + access_token.encode('ascii')))
    if content:
        req.requestHeaders.addRawHeader(b'Content-Type', b'application/json')
    req.requestReceived(method, path, b'1.1')
    return (req, channel)
Make a web request using the given method and path, feed it the
content, and return the Request and the Channel underneath.

Args:
    method (bytes/unicode): The HTTP request method ("verb").
    path (bytes/unicode): The HTTP path, suitably URL encoded (e.g.
    escaped UTF-8 & spaces and such).
    content (bytes or dict): The body of the request. JSON-encoded, if
    a dict.
    shorthand: Whether to try and be helpful and prefix the given URL
    with the usual REST API path, if it doesn't contain it.

Returns:
    A synapse.http.site.SynapseRequest.
def make_request(reactor, method, path, content=b, access_token=None, request=SynapseRequest, shorthand=True):
    '\n    Make a web request using the given method and path, feed it the\n    content, and return the Request and the Channel underneath.\n\n    Args:\n        method (bytes/unicode): The HTTP request method ("verb").\n        path (bytes/unicode): The HTTP path, suitably URL encoded (e.g.\n        escaped UTF-8 & spaces and such).\n        content (bytes or dict): The body of the request. JSON-encoded, if\n        a dict.\n        shorthand: Whether to try and be helpful and prefix the given URL\n        with the usual REST API path, if it doesn\'t contain it.\n\n    Returns:\n        A synapse.http.site.SynapseRequest.\n    '
    if (not isinstance(method, bytes)):
        method = method.encode('ascii')
    if (not isinstance(path, bytes)):
        path = path.encode('ascii')
    if (shorthand and (not path.startswith(b'/_matrix'))):
        path = (b'/_matrix/client/r0/' + path)
        path = path.replace(b'//', b'/')
    if isinstance(content, text_type):
        content = content.encode('utf8')
    site = FakeSite()
    channel = FakeChannel(reactor)
    req = request(site, channel)
    req.process = (lambda : b)
    req.content = BytesIO(content)
    if access_token:
        req.requestHeaders.addRawHeader(b'Authorization', (b'Bearer ' + access_token.encode('ascii')))
    if content:
        req.requestHeaders.addRawHeader(b'Content-Type', b'application/json')
    req.requestReceived(method, path, b'1.1')
    return (req, channel)