Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Why QHttpRequestHeader / QHttpResponseHeader are deprecated?
Forum Updated to NodeBB v4.3 + New Features

Why QHttpRequestHeader / QHttpResponseHeader are deprecated?

Scheduled Pinned Locked Moved General and Desktop
6 Posts 3 Posters 9.0k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    alrez
    wrote on last edited by
    #1

    I just moved to new Qt and discovered that QHttpRequestHeader / QHttpResponseHeader classes are obsolete.

    What is a reason and what should I use instead in order to implement http requests? I am aware about QNetworkAccessManager class and it is very convenient for client implementation but it is pretty unusable for server implementation.

    1 Reply Last reply
    0
    • V Offline
      V Offline
      vsorokin
      wrote on last edited by
      #2

      This classes worked with QHttp, which also obsolete.

      How do you use QHttp class for server implementation? IMHO it is only client class.
      Servers traditionally realized on sockets (QTcpSocket for example).

      --
      Vasiliy

      1 Reply Last reply
      0
      • A Offline
        A Offline
        alrez
        wrote on last edited by
        #3

        Yes, you are right, QTcpSocket is a right way to implement server on low level.

        But then http server should accept http header, parse it, analyse it and send http response. QHttpRequestHeader / QHttpResponseHeader classes are very convenient for that and they save some manual parsing.

        So, probably the right question is: "why QHttp class is obsolete"?

        1 Reply Last reply
        0
        • G Offline
          G Offline
          goetz
          wrote on last edited by
          #4

          QNetworkAccessManager is much more flexible and not limited to a single protocol. With QHttp/QFtp you had to decide on the application level which protocol to use, with QNAM you leave that to the network layer and only pass an URL to it.

          You can still use QHttpRequestHeader and QHttpResponseHeader for your purposes. As Qt 4 will be source compatible for its lifetime you must not worry that it vanishes sometime in the future. That could only happen with a Qt 5.

          http://www.catb.org/~esr/faqs/smart-questions.html

          1 Reply Last reply
          0
          • A Offline
            A Offline
            alrez
            wrote on last edited by
            #5

            Thank you, I just worried QHttp class will be out some time if it obsolete now.

            QNetworkAccessManager is very client-oriented. I didn't find a way use it for server implementation.

            1 Reply Last reply
            0
            • G Offline
              G Offline
              goetz
              wrote on last edited by
              #6

              It's not meant for that purpose and I seriously doubt that it would be helpful in any way.

              http://www.catb.org/~esr/faqs/smart-questions.html

              1 Reply Last reply
              0

              • Login

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • Users
              • Groups
              • Search
              • Get Qt Extensions
              • Unsolved