(self)
return super(MimicLoggingRequest, self).finish()
Before finishing the request, log the response.
Before finishing the request, log the response.
Before finishing the request log the response .
def finish(self):
        """
        Before finishing the request, log the response.
        """
        content = self.response_body_for_logging.getvalue()
        log("Responding with {code} for: {method} {url}\n"
            "Headers: {headers}\n"
            "{body}",
            method=self.method.decode("utf-8"), url=self.uri.decode("utf-8"),
            code=self.code,
            headers=json.dumps(
                {k.decode("utf-8"): [vv.decode("utf-8") for vv in v]
                 for (k, v) in self.responseHeaders.getAllRawHeaders()}),
            body=("\n" + content.decode("utf-8") + "\n" if content else ""))
        return super(MimicLoggingRequest, self).finish()
def finish ( self ) : content = self . response_body_for_logging . getvalue ( ) log ( "Responding with {code} for: {method} {url}\n" "Headers: {headers}\n" "{body}" , method = self . method . decode ( "utf-8" ) , url = self . uri . decode ( "utf-8" ) , code = self . code , headers = json . dumps ( { k . decode ( "utf-8" ) : [ vv . decode ( "utf-8" ) for vv in v ] for ( k , v ) in self . responseHeaders . getAllRawHeaders ( ) } ) , body = ( "\n" + content . decode ( "utf-8" ) + "\n" if content else "" ) ) return super ( MimicLoggingRequest , self ) . finish ( )