QGIS API Documentation  2.18.21-Las Palmas (9fba24a)
Public Member Functions | Static Public Member Functions | List of all members
QgsServer Class Reference

The QgsServer class provides OGC web services. More...

#include <qgsserver.h>

Public Member Functions

 QgsServer (int &argc, char **argv)
 Standard ctor for CGI/FCGI. More...
 
 QgsServer ()
 The following is mainly for python bindings, that do not pass argc/argv. More...
 
 ~QgsServer ()
 
QPair< QByteArray, QByteArrayhandleRequest (const QString &queryString=QString())
 Handles the request. More...
 
void putenv (const QString &var, const QString &val)
 Set environment variable. More...
 

Static Public Member Functions

static bool init (int &argc, char **argv)
 Server initialization: intialise QGIS ang QT core application. More...
 
static bool init ()
 The following is mainly for python bindings, that do not pass argc/argv. More...
 

Detailed Description

The QgsServer class provides OGC web services.

Definition at line 47 of file qgsserver.h.

Constructor & Destructor Documentation

◆ QgsServer() [1/2]

QgsServer::QgsServer ( int &  argc,
char **  argv 
)

Standard ctor for CGI/FCGI.

Note
Not available in Python bindings

◆ QgsServer() [2/2]

QgsServer::QgsServer ( )

The following is mainly for python bindings, that do not pass argc/argv.

◆ ~QgsServer()

QgsServer::~QgsServer ( )

Member Function Documentation

◆ handleRequest()

QPair<QByteArray, QByteArray> QgsServer::handleRequest ( const QString queryString = QString())

Handles the request.

The output is normally printed trough FCGI printf by the request handler or, in case the server has been invoked from python bindings, a flag is set that captures all the output headers and body, instead of printing it returns the output as a QPair of QByteArray. The query string is normally read from environment but can be also passed in args and in this case overrides the environment variable

Parameters
queryStringoptional QString containing the query string
Returns
the response headers and body QPair of QByteArray if called from python bindings, empty otherwise

◆ init() [1/2]

static bool QgsServer::init ( int &  argc,
char **  argv 
)
static

Server initialization: intialise QGIS ang QT core application.

Note
Not available in Python bindings

◆ init() [2/2]

static bool QgsServer::init ( )
static

The following is mainly for python bindings, that do not pass argc/argv.

◆ putenv()

void QgsServer::putenv ( const QString var,
const QString val 
)

Set environment variable.

Parameters
varenvironment variable name
valvalue
Note
added in 2.14

The documentation for this class was generated from the following file: