mirror of
https://github.com/nomic-ai/gpt4all.git
synced 2025-06-29 08:47:39 +00:00
Use compact json format.
This commit is contained in:
parent
d14936bfd6
commit
da3828af89
@ -123,7 +123,7 @@ bool Network::packageAndSendJson(const QString &ingestId, const QString &json)
|
|||||||
QSslConfiguration conf = request.sslConfiguration();
|
QSslConfiguration conf = request.sslConfiguration();
|
||||||
conf.setPeerVerifyMode(QSslSocket::VerifyNone);
|
conf.setPeerVerifyMode(QSslSocket::VerifyNone);
|
||||||
request.setSslConfiguration(conf);
|
request.setSslConfiguration(conf);
|
||||||
QByteArray body(newDoc.toJson());
|
QByteArray body(newDoc.toJson(QJsonDocument::Compact));
|
||||||
request.setHeader(QNetworkRequest::ContentTypeHeader, "application/json");
|
request.setHeader(QNetworkRequest::ContentTypeHeader, "application/json");
|
||||||
QNetworkReply *jsonReply = m_networkManager.post(request, body);
|
QNetworkReply *jsonReply = m_networkManager.post(request, body);
|
||||||
connect(jsonReply, &QNetworkReply::finished, this, &Network::handleJsonUploadFinished);
|
connect(jsonReply, &QNetworkReply::finished, this, &Network::handleJsonUploadFinished);
|
||||||
@ -190,7 +190,7 @@ void Network::sendOptOut()
|
|||||||
|
|
||||||
QJsonDocument doc;
|
QJsonDocument doc;
|
||||||
doc.setArray(array);
|
doc.setArray(array);
|
||||||
sendMixpanel(doc.toJson(), true /*isOptOut*/);
|
sendMixpanel(doc.toJson(QJsonDocument::Compact), true /*isOptOut*/);
|
||||||
|
|
||||||
#if defined(DEBUG)
|
#if defined(DEBUG)
|
||||||
printf("%s %s\n", qPrintable("opt_out"), qPrintable(doc.toJson(QJsonDocument::Indented)));
|
printf("%s %s\n", qPrintable("opt_out"), qPrintable(doc.toJson(QJsonDocument::Indented)));
|
||||||
@ -410,7 +410,7 @@ void Network::sendMixpanelEvent(const QString &ev, const QVector<KeyValue> &valu
|
|||||||
|
|
||||||
QJsonDocument doc;
|
QJsonDocument doc;
|
||||||
doc.setArray(array);
|
doc.setArray(array);
|
||||||
sendMixpanel(doc.toJson());
|
sendMixpanel(doc.toJson(QJsonDocument::Compact));
|
||||||
|
|
||||||
#if defined(DEBUG)
|
#if defined(DEBUG)
|
||||||
printf("%s %s\n", qPrintable(ev), qPrintable(doc.toJson(QJsonDocument::Indented)));
|
printf("%s %s\n", qPrintable(ev), qPrintable(doc.toJson(QJsonDocument::Indented)));
|
||||||
|
Loading…
Reference in New Issue
Block a user