Details
-
Suggestion
-
Resolution: Done
-
P2: Important
-
5.13.0
-
None
-
-
73175545e69cc5f07a7a1447a6b8c4c74d9795c8 (qt-labs/qthttpserver/master)
Description
Currently, we can only construct a QHttpServerResponse from the content type, the actual content and a status code. It would be very useful to be able to also set arbitrary HTTP-Headers for the response.
A basic use case would be content encoding: If we want to compress data before sending it, the Content-Encoding header must be set - which requires the application to set this header.
Note: I am aware that it is possible to specify headers via QHttpServerResponder. However, we cannot use this class directly when working with QHttpServer. I personally think this is simple and relevant enough to extend QHttpServerResponse to allow custom headers even when using the "simplified" interface.