'Create a new request.
Args:
request: const QNetworkRequest & req
_op: Operation op
_outgoing_data: QIODevice * outgoingData
Return:
A QNetworkReply.'

def createRequest(self, _op, request, _outgoing_data):

    try:
        (mimetype, data) = qutescheme.data_for_url(request.url())
    except qutescheme.NoHandlerFound:
        errorstr = 'No    handler    found    for    {}!'.format(request.url().toDisplayString())
        return networkreply.ErrorNetworkReply(request, errorstr, QNetworkReply.ContentNotFoundError, self.parent())
    except qutescheme.QuteSchemeOSError as e:
        return networkreply.ErrorNetworkReply(request, str(e), QNetworkReply.ContentNotFoundError, self.parent())
    except qutescheme.QuteSchemeError as e:
        return networkreply.ErrorNetworkReply(request, e.errorstring, e.error, self.parent())
    except qutescheme.Redirect as e:
        qtutils.ensure_valid(e.url)
        return networkreply.RedirectNetworkReply(e.url, self.parent())
    return networkreply.FixedDataNetworkReply(request, data, mimetype, self.parent())
