27 QIODevice *iodev =
io();
30 iodev->write(
data.toUtf8() );
40 QIODevice *iodev =
io();
43 return iodev->write( byteArray );
50 QIODevice *iodev =
io();
53 return iodev->write(
data, maxsize );
60 QIODevice *iodev =
io();
63 return iodev->write(
data );
85 QString responseFormat;
96 setHeader(
"Content-Type", responseFormat );
Base class for feedback objects to be used for cancellation of something running in a worker thread.
static void logMessage(const QString &message, const QString &tag=QString(), Qgis::MessageLevel level=Qgis::MessageLevel::Warning, bool notifyUser=true)
Adds a message to the log instance (and creates it if necessary).
Exception base class for server exceptions.
virtual QByteArray formatResponse(QString &responseFormat) const
Formats the exception for sending to client.
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 flush()
Flushes the current output buffer to the network.
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.
virtual void finish()
Finish the response, ending the transaction.
virtual bool headersSent() const =0
Returns true if the headers have already been sent.
virtual QIODevice * io()=0
Returns the underlying QIODevice.
virtual void setStatusCode(int code)=0
Set the http status code.