qint64 TActionContext::writeResponse(int statusCode, THttpResponseHeader &header, const QByteArray &contentType, QIODevice *body, qint64 length) { T_TRACEFUNC("statusCode:%d contentType:%s length:%s", statusCode, contentType.data(), qPrintable(QString::number(length))); header.setStatusLine(statusCode, THttpUtility::getResponseReasonPhrase(statusCode)); if (!contentType.isEmpty()) header.setContentType(contentType); return writeResponse(header, body, length); }