'This method mangles the request.
:param request: This is the request to mangle.
:return: A mangled version of the request.'

def mangle_request(self, request):

    data = request.get_data()
    for (regex, string) in self._manglers['q']['b']:
        data = regex.sub(string, data)
    header_string = str(request.get_headers())
    for (regex, string) in self._manglers['q']['h']:
        header_string = regex.sub(string, header_string)
    headers_inst = Headers.from_string(header_string)
    request.set_headers(headers_inst)
    request.add_data(data)
    return request
