Class: QgsBufferServerResponse

Class defining buffered response

Class Hierarchy

Inheritance diagram of qgis.server.QgsBufferServerResponse

Base classes

QgsServerResponse

Methods

body

Returns body

finish

Finish the response, ending the transaction

flush

Flushes the current output buffer to the network

headers

Returns all the headers

sendError

Send error This method delegates error handling at the server level.

class qgis.server.QgsBufferServerResponse[source]

Bases: QgsServerResponse

body(self) QByteArray[source]

Returns body

Return type:

QByteArray

finish(self)[source]

Finish the response, ending the transaction

flush(self)[source]

Flushes the current output buffer to the network

flush()’ may be called multiple times. For HTTP transactions headers will be written on the first call to ‘flush()’.

headers(self) Dict[str, str]

Returns all the headers

Return type:

Dict[str, str]

sendError(self, code: int, message: str | None)[source]

Send error This method delegates error handling at the server level. This is different from calling setReturnCode() which let you return a specific response body. Calling sendError() will end the transaction and any attempt to write data or set headers will be an error.

Parameters:
  • code (int) – HHTP return code value

  • message (Optional[str]) – An informative error message