19 #ifndef QGSBUFFERSERVERRESPONSE_H 20 #define QGSBUFFERSERVERRESPONSE_H 22 #include "qgis_server.h" 50 void setHeader(
const QString &key,
const QString &value )
override;
61 QString
header(
const QString &key )
const override;
66 QMap<QString, QString>
headers()
const override {
return mHeaders; }
93 void sendError(
int code,
const QString &message )
override;
98 QIODevice *
io()
override;
111 void flush()
override;
116 void clear()
override;
127 QByteArray
data()
const override;
139 QByteArray
body()
const {
return mBody; }
148 QMap<QString, QString> mHeaders;
151 bool mFinished =
false;
152 bool mHeadersSent =
false;
153 int mStatusCode = 200;
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 void truncate()=0
Truncate data.
virtual void sendError(int code, const QString &message)=0
Send error This method delegates error handling at the server level.
virtual void clear()=0
Reset all headers and content for this response.
virtual void removeHeader(const QString &key)=0
Clear header Undo a previous 'setHeader' call.
virtual void setStatusCode(int code)=0
Set the http status code.
QByteArray body() const
Returns body.
virtual void flush()=0
Flushes the current output buffer to the network.
Class defining buffered response.
virtual QString header(const QString &key) const =0
Returns the header value.
virtual QByteArray data() const =0
Gets the data written so far.
int statusCode() const override
Returns the http status code.
QMap< QString, QString > headers() const override
Returns all the headers.
virtual QIODevice * io()=0
Returns the underlying QIODevice.
virtual bool headersSent() const =0
Returns true if the headers have already been sent.
QgsServerResponse Class defining response interface passed to services QgsService::executeRequest() m...
virtual void finish()=0
Finish the response, ending the transaction.