Advertisement
saurabhpatel7717

Untitled

Jun 22nd, 2013
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.91 KB | None | 0 0
  1. void googled::createfolder(QNetworkReply* reply){
  2. QUrl url("https://www.googleapis.com/drive/v2/files");
  3.  
  4. QByteArray data = reply->readAll();
  5. //qDebug() << data;
  6. QString x = getValue(data,"access_token");
  7. QString y = "Bearer " + x;
  8. m_n = new QNetworkAccessManager;
  9. QObject::connect(m_n, SIGNAL(finished(QNetworkReply *)),
  10. this, SLOT(foldercreateSlot(QNetworkReply *)));
  11. QByteArray arr;
  12. QNetworkRequest request;
  13. QString str;
  14. str += QString("{");
  15. str += "\r\t";
  16. str += QString("\"title\": \"SMP\"");
  17. str += "\r\n";
  18. str += "\r\t";
  19. str += QString("\"mimeType\": \"application/vnd.google-apps.folder\"");
  20. str += "\r\n";
  21.  
  22. str += QString("}");
  23. request.setUrl(url);
  24. qDebug() << str;
  25. request.setRawHeader("Content-Type","application/json");
  26. request.setRawHeader("Authorization",y.toLatin1());
  27. m_n->post(request,arr);
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement