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. QHttpServer how to specify return code/status?
Forum Updated to NodeBB v4.3 + New Features

QHttpServer how to specify return code/status?

Scheduled Pinned Locked Moved Solved General and Desktop
qhttpserver
4 Posts 2 Posters 305 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.
  • D Offline
    D Offline
    Dariusz
    wrote on last edited by
    #1

    Hey
    As question ask, how can I specify which error/status code respone will return for get/etc requests?

    Regards
    Dariusz

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      Based on the documentation, I would say that you have to build the QHttpServerResponse with the information you want to return.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • D Offline
        D Offline
        Dariusz
        wrote on last edited by
        #3

        Ohhhhhhhhh so rat her than just doing

        return "Hello world"
        I would do
        return QHttpServerResponse (config/etc)

        ahhhhhhh make sense. I'm dumbo! thanks!
        I was lost by the crazy template functions that route was doing and didn't think of it.

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          No worries, templates are pretty obscure.

          If that fixes your issue, please mark the thread as solved using the topic tools button or the three dotted menu beside the answer you deem correct so other forum members may know a solution has been found :-)

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          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