private function normalizeBody($body = null)
    {
        $body = $body ? $body : new Stream(fopen('php://temp', 'r+'));
        if (is_string($body)) {
            $memoryStream = fopen('php://temp', 'r+');
            fwrite($memoryStream, $body);
            rewind($memoryStream);
            $body = new Stream($memoryStream);
        } elseif (!($body instanceof StreamInterface)) {
            throw new InvalidArgumentException(
                'Body must be a string, null or implement Psr\Http\Message\StreamInterface'
            );
        }

        return $body;
    }