Details
-
Task
-
Resolution: Fixed
-
P3: Somewhat important
-
None
-
None
-
3
-
Foundation Sprint 63
Description
QHttpServer improvement:
A common use case in the APIs in the modifying methods is to return created/updated value and an HTTP status code 2XX which is not 200 (e.g. Created).
It would be much easier for the user to return a `QHttpServerResponse` both with value and status code instead of using `QHttpServerResponder` or specifying `mimeType` in the `QHttpServerResponse`
e.g.
return QHttpServerResponse(data, QHttpServerResponder::StatusCode::Created);
Add Status code to those methods (defaults to `StatusCode::Ok`):
QHttpServerResponse(const QJsonArray &data) QHttpServerResponse(const QJsonObject &data) QHttpServerResponse(QByteArray &&data) QHttpServerResponse(const QByteArray &data) QHttpServerResponse(const QString &data) QHttpServerResponse(const char *data)