QGIS API Documentation  3.24.2-Tisler (13c1a02865)
qgshttpheaders.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgshttpheaders.h
3  This class implements simple http header management.
4 
5  -------------------
6  begin : 2021-09-09
7  copyright : (C) 2021 B. De Mezzo
8  email : benoit dot de dot mezzo at oslandia dot com
9 
10 ***************************************************************************/
11 
12 /***************************************************************************
13  * *
14  * This program is free software; you can redistribute it and/or modify *
15  * it under the terms of the GNU General Public License as published by *
16  * the Free Software Foundation; either version 2 of the License, or *
17  * (at your option) any later version. *
18  * *
19  ***************************************************************************/
20 
21 #ifndef QGSHTTPHEADERS_H
22 #define QGSHTTPHEADERS_H
23 
24 #include <QNetworkRequest>
25 #include <QMap>
26 #include "qgis_core.h"
27 #include "qgis_sip.h"
28 #include "qgssettingsentry.h"
29 
35 class CORE_EXPORT QgsHttpHeaders
36 {
37  public:
38 
39 #ifndef SIP_RUN
40 
44  static const QString KEY_PREFIX;
45 #endif
46 
51  QgsHttpHeaders( const QMap<QString, QVariant> &headers );
52 
57 
63  QgsHttpHeaders( const QgsSettings &settings, const QString &key = QString() );
64 
65  virtual ~QgsHttpHeaders();
66 
71  bool updateNetworkRequest( QNetworkRequest &request ) const;
72 
78  void updateSettings( QgsSettings &settings, const QString &key = QString() ) const;
79 
85  void setFromSettings( const QgsSettings &settings, const QString &key = QString() );
86 
91  QVariant &operator[]( const QString &key );
92 
93  QgsHttpHeaders &operator = ( const QMap<QString, QVariant> &headers ) SIP_SKIP;
94 
98  QList<QString> keys() const;
99 
100 #ifndef SIP_RUN
101 
106  const QVariant operator[]( const QString &key ) const;
107 #endif
108 
109  private:
110  QMap<QString, QVariant> mHeaders;
111 };
112 
113 #endif // QGSHTTPHEADERS_H
This class implements simple http header management.
static const QString KEY_PREFIX
Used in settings.
QgsHttpHeaders()
default constructor
virtual ~QgsHttpHeaders()
This class is a composition of two QSettings instances:
Definition: qgssettings.h:62
#define SIP_SKIP
Definition: qgis_sip.h:126