Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void googled::createfolder(QNetworkReply* reply){
- QUrl url("https://www.googleapis.com/drive/v2/files");
- QByteArray data = reply->readAll();
- //qDebug() << data;
- QString x = getValue(data,"access_token");
- QString y = "Bearer " + x;
- m_n = new QNetworkAccessManager;
- QObject::connect(m_n, SIGNAL(finished(QNetworkReply *)),
- this, SLOT(foldercreateSlot(QNetworkReply *)));
- QByteArray arr;
- QNetworkRequest request;
- QString str;
- str += QString("{");
- str += "\r\t";
- str += QString("\"title\": \"SMP\"");
- str += "\r\n";
- str += "\r\t";
- str += QString("\"mimeType\": \"application/vnd.google-apps.folder\"");
- str += "\r\n";
- str += QString("}");
- request.setUrl(url);
- qDebug() << str;
- request.setRawHeader("Content-Type","application/json");
- request.setRawHeader("Authorization",y.toLatin1());
- m_n->post(request,arr);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement