(self, pattern, repl, *args, **kwargs)
return c
Replaces a regular expression pattern with repl in both the headers
            and the body of the request. Encoded content will be decoded before
            replacement, and re-encoded afterwards.

            Returns the number of replacements made.
Replaces a regular expression pattern with repl in both the headers
            and the body of the request. Encoded content will be decoded before
            replacement, and re-encoded afterwards.
Replaces a regular expression pattern with repl in both the headers and the body of the request . Encoded content will be decoded before replacement and re - encoded afterwards .
def replace(self, pattern, repl, *args, **kwargs):
        """
            Replaces a regular expression pattern with repl in both the headers
            and the body of the request. Encoded content will be decoded before
            replacement, and re-encoded afterwards.

            Returns the number of replacements made.
        """
        with decoded(self):
            self.content, c = utils.safe_subn(pattern, repl, self.content, *args, **kwargs)
        self.path, pc = utils.safe_subn(pattern, repl, self.path, *args, **kwargs)
        c += pc
        c += self.headers.replace(pattern, repl, *args, **kwargs)
        return c
def replace ( self , pattern , repl , * args , * * kwargs ) : with decoded ( self ) : self . content , c = utils . safe_subn ( pattern , repl , self . content , * args , * * kwargs ) self . path , pc = utils . safe_subn ( pattern , repl , self . path , * args , * * kwargs ) c += pc c += self . headers . replace ( pattern , repl , * args , * * kwargs ) return c