QGIS API Documentation
3.16.0-Hannover (43b64b13f3)
|
Go to the documentation of this file.
29 mBuffer.open( QIODevice::ReadWrite );
35 mHeaders.remove( key );
41 mHeaders.insert( key, value );
51 return mHeaders.value( key );
69 setHeader( QStringLiteral(
"Content-Type" ), QStringLiteral(
"text/plain; charset=utf-8" ) );
89 if ( ! mHeaders.contains(
"Content-Length" ) )
91 mHeaders.insert( QStringLiteral(
"Content-Length" ), QString::number( mBuffer.pos() ) );
100 if ( ! mHeadersSent )
106 QByteArray &ba = mBuffer.buffer();
116 mBuffer.buffer().clear();
122 return mBuffer.data();
129 mBuffer.buffer().clear();
void clear() override
Reset all headers and content for this response.
QgsBufferServerResponse()
void removeHeader(const QString &key) override
Clear header Undo a previous 'setHeader' call.
void setStatusCode(int code) override
Set the http status code.
virtual void write(const QString &data)
Write string This is a convenient method that will write directly to the underlying I/O device.
QString header(const QString &key) const override
Returns the header value.
void finish() override
Finish the response, ending the transaction.
void sendError(int code, const QString &message) override
Send error This method delegates error handling at the server level.
void truncate() override
Truncate data.
void flush() override
Flushes the current output buffer to the network.
QByteArray data() const override
Gets the data written so far.
static void logMessage(const QString &message, const QString &tag=QString(), Qgis::MessageLevel level=Qgis::Warning, bool notifyUser=true)
Adds a message to the log instance (and creates it if necessary).
void setHeader(const QString &key, const QString &value) override
Set Header entry Add Header entry to the response Note that it is usually an error to set Header afte...
bool headersSent() const override
Returns true if the headers have already been sent.
QIODevice * io() override
Returns the underlying QIODevice.