private function scrubAndFormatDetailedMessage(
        RequestInterface $request,
        ResponseInterface $response = null,
        Exception $error = null
    ) {
        $requestHeaders = LogMessageScrubbers::scrubHttpHeadersArray(
            $request->getHeaders(),
            $this->requestHttpHeadersToScrub
        );
        $changes = [
            'set_headers' => $requestHeaders,
            // The request body is encoded and thus needed to be decoded here
            // to provide a readable log message.
            'body' => urldecode($request->getBody())
        ];
        $clonedRequest = \GuzzleHttp\Psr7\modify_request($request, $changes);

        return $this->detailedMessageFormatter->format(
            $clonedRequest,
            $response,
            $error
        );
    }