Cute Learning Hub
The Cute::Server::HttpBroker allows HTTP handlers to fetch the parsed HttpRequest sent by clients. It also allows HTTP handlers to send the HTTP response back to the client. More...
|const Cute::Server::HttpRequest &||request() const|
|void||sendResponse(const Cute::Server::HttpResponse &response)|
Returns the HTTP request sent by the client.
Sends the response back to the client. This method allows the remote object handling the HTTP request to send the response after the slot returns. This way, the remote object can interact with backend services like databases and only send the HTTP response to the client after receiving the response from the backend service.
After sending the HTTP response to the client, the Cute server calls the deleteLater slot on the remote object. If the HTTP response contains the "Connection: close" header, the Cute server closes the connection after sending the HTTP response to the client. Otherwise, the connection stays open. The Cute server creates a remote object to process every HTTP request received in a connection. The Cute server supports pipelining. Thus, clients can send multiple HTTP requests before receiving any response from the server.