HttpClient.h 747 B

123456789101112131415161718192021222324252627282930313233
  1. #ifndef HTTPCLIENT_H
  2. #define HTTPCLIENT_H
  3. #include <QObject>
  4. #include <QNetworkAccessManager>
  5. #include <QFile>
  6. #include <QNetworkReply>
  7. #include <windows.h>
  8. #include <QEventLoop>
  9. #include <QDataStream>
  10. #include <QFileInfo>
  11. #include <QHttpMultiPart>
  12. #include <QSslConfiguration>
  13. class HttpClient : public QObject
  14. {
  15. Q_OBJECT
  16. public:
  17. HttpClient();
  18. //备用接口,用来传文件
  19. bool post(QString strUrl, QString filePath, QString * errString);
  20. //连接服务器,发送和接收数据,接口3
  21. bool postQString(QString strUrl, QString strName, QString * errString, QString *getCardBox);
  22. private:
  23. QNetworkAccessManager *m_Manager_;
  24. QNetworkAccessManager *m_Manager_QString;
  25. };
  26. #endif // HTTPCLIENT_H