19#ifndef QGSSERVERRESPONSE_H
20#define QGSSERVERRESPONSE_H
22#include "qgis_server.h"
52 virtual void setHeader(
const QString &key,
const QString &value ) = 0;
63 virtual QString
header(
const QString &key )
const = 0;
68 virtual QMap<QString, QString>
headers()
const = 0;
96 virtual void sendError(
int code,
const QString &message ) = 0;
103 virtual void write(
const QString &
data );
111 virtual qint64
write(
const QByteArray &byteArray );
154 virtual QIODevice *
io() = 0;
184 virtual QByteArray
data() const = 0;
Base class for feedback objects to be used for cancellation of something running in a worker thread.
Exception base class for server exceptions.
virtual void write(const QString &data)
Write string This is a convenient method that will write directly to the underlying I/O device.
virtual void removeHeader(const QString &key)=0
Clear header Undo a previous 'setHeader' call.
virtual int statusCode() const =0
Returns the http status code.
virtual void truncate()=0
Truncate data.
virtual ~QgsServerResponse()=default
virtual void flush()
Flushes the current output buffer to the network.
virtual QMap< QString, QString > headers() const =0
Returns the header value.
virtual QByteArray data() const =0
Gets the data written so far.
virtual void setHeader(const QString &key, const QString &value)=0
Set Header entry Add Header entry to the response Note that it is usually an error to set Header afte...
virtual QgsFeedback * feedback() const
Returns the socket feedback if any.
virtual void clear()=0
Reset all headers and content for this response.
QgsServerResponse()=default
virtual void finish()
Finish the response, ending the transaction.
virtual bool headersSent() const =0
Returns true if the headers have already been sent.
virtual void sendError(int code, const QString &message)=0
Send error This method delegates error handling at the server level.
virtual QIODevice * io()=0
Returns the underlying QIODevice.
virtual QString header(const QString &key) const =0
Returns the header value.
virtual void setStatusCode(int code)=0
Set the http status code.
#define SIP_VIRTUALERRORHANDLER(name)
#define SIP_THROW(name,...)