Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-105366

QHttpServer: Overload QHttpServerResponse with status codes

XMLWordPrintable

    • Icon: Task Task
    • Resolution: Fixed
    • Icon: P3: Somewhat important P3: Somewhat important
    • 6.4.0 Beta3
    • None
    • Qt Http Server
    • None

      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)
      

       

       

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            kokujawa Konrad Kujawa (Inactive)
            kokujawa Konrad Kujawa (Inactive)
            Vladimir Minenko Vladimir Minenko
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes