HTTP Patch方法是除了post,get,put,delete之外的一个新方式,
网上查不到的,也算是独家吧:
主要用下面这个方法:
QNetworkReply *sendCustomRequest(const QNetworkRequest &request, const QByteArray &verb, QIODevice *data = 0);
代码:
QNetworkAccessManager *_qnetwork = new QNetworkAccessManager();
QNetworkReply* reply=0;
...
QByteArray * _b_arr = new QByteArray(QString("参数").toUtf8());
QBuffer *_qbf_upload =new QBuffer( _b_arr);
reply = _qnetwork->sendCustomRequest (mreq,QByteArray("PATCH"),_qbf_upload);
...
QT QNetworkAccessManager 如何支持RESTFul的HTTP Patch方法,布布扣,bubuko.com
时间: 2024-11-06 12:58:09