def _control_response(self, request, full_url, headers):
    parsed_url = urlparse(full_url)
    query = parse_qs(parsed_url.query, keep_blank_values=True)
    method = request.method
    if hasattr(request, 'body'):
        body = request.body
        if hasattr(body, 'read'):
            body = body.read()
    else:
        body = request.data
    if (body is None):
        body = b''
    if (method == 'GET'):
        return self._control_response_get(request, query, headers)
    elif (method == 'PUT'):
        return self._control_response_put(request, body, query, headers)
    elif (method == 'DELETE'):
        return self._control_response_delete(request, query, headers)
    else:
        raise NotImplementedError('Method {0} has not been implemented in the S3 backend yet'.format(method))
def _control_response(self, request, full_url, headers):
    parsed_url = urlparse(full_url)
    query = parse_qs(parsed_url.query, keep_blank_values=True)
    method = request.method
    if hasattr(request, 'body'):
        body = request.body
        if hasattr(body, 'read'):
            body = body.read()
    else:
        body = request.data
    if (body is None):
        body = b
    if (method == 'GET'):
        return self._control_response_get(request, query, headers)
    elif (method == 'PUT'):
        return self._control_response_put(request, body, query, headers)
    elif (method == 'DELETE'):
        return self._control_response_delete(request, query, headers)
    else:
        raise NotImplementedError('Method {0} has not been implemented in the S3 backend yet'.format(method))