SDRAngel  4.11.5
Developer docs for <a href="https://github.com/f4exb/sdrangel">SDRangel<\a>, an Open Source Qt5 / OpenGL 3.0+ SDR and signal analyzer frontend to various hardware.
SWGHttpRequest.h
Go to the documentation of this file.
1 
19 #ifndef SWG_HTTPREQUESTWORKER_H
20 #define SWG_HTTPREQUESTWORKER_H
21 
22 #include <QObject>
23 #include <QString>
24 #include <QMap>
25 #include <QNetworkAccessManager>
26 #include <QNetworkReply>
27 
28 
29 
30 namespace SWGSDRangel {
31 
33 
35 
36 public:
37  QString variable_name;
38  QString local_filename;
40  QString mime_type;
41 
42 };
43 
44 
46 
47 public:
48  QString url_str;
49  QString http_method;
51  QMap<QString, QString> vars;
52  QMap<QString, QString> headers;
53  QList<SWGHttpRequestInputFileElement> files;
54  QByteArray request_body;
55 
57  SWGHttpRequestInput(QString v_url_str, QString v_http_method);
58  void initialize();
59  void add_var(QString key, QString value);
60  void add_file(QString variable_name, QString local_filename, QString request_filename, QString mime_type);
61 
62 };
63 
64 
65 class SWGHttpRequestWorker : public QObject {
66  Q_OBJECT
67 
68 public:
69  QByteArray response;
70  QNetworkReply::NetworkError error_type;
71  QString error_str;
72 
73  explicit SWGHttpRequestWorker(QObject *parent = 0);
74  virtual ~SWGHttpRequestWorker();
75 
76  QString http_attribute_encode(QString attribute_name, QString input);
77  void execute(SWGHttpRequestInput *input);
78  static QSslConfiguration* sslDefaultConfiguration;
79 
80 signals:
81  void on_execution_finished(SWGHttpRequestWorker *worker);
82 
83 private:
84  QNetworkAccessManager *manager;
85 
86 private slots:
87  void on_manager_finished(QNetworkReply *reply);
88 
89 };
90 
91 }
92 
93 #endif // SWG_HTTPREQUESTWORKER_H
QMap< QString, QString > vars
QList< SWGHttpRequestInputFileElement > files
SWGHttpRequestVarLayout var_layout
static QSslConfiguration * sslDefaultConfiguration
QNetworkAccessManager * manager
QMap< QString, QString > headers
QNetworkReply::NetworkError error_type