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)
Attachments
For Gerrit Dashboard: QTBUG-105366 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
425214,5 | Overload QHttpServerResponse with status codes | dev | qt/qthttpserver | Status: MERGED | +2 | 0 |
425910,2 | Overload QHttpServerResponse with status codes | 6.4 | qt/qthttpserver | Status: MERGED | +2 | 0 |