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. Are there any higher level class to build a REST client?
Forum Update on Monday, May 27th 2025

Are there any higher level class to build a REST client?

Scheduled Pinned Locked Moved Unsolved General and Desktop
4 Posts 2 Posters 735 Views
  • 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.
  • J Offline
    J Offline
    JulienMaille
    wrote on last edited by
    #1

    I recently got the request to change a piece of code that is performing SQL insertions to a piece of "2.0" code that push JSON/xml to a REST server instead.
    I was told that I live in the past and no one messes up with database nowadays :)

    Are you guys aware of any library that could do that? Or should I start from scratch with QNetwork classes?
    Thanks in advance for your help!

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

      Hi,

      Well, it's one way to shield your database from external connection and it also allows you to completely change your backend if needed without having to touch your application.

      Anyway, do you mean the client or the backend part ?

      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
      • J Offline
        J Offline
        JulienMaille
        wrote on last edited by
        #3

        Yes I do agree this is a good way to separate the data as they are generated by my program and their copy handled in the database.
        As mentioned in the title, I'm looking for help regarding the client, not the backend.
        FWII I just need to implement a client that POST the data array to the backend (=server) am I right?

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

          I managed to miss client after REST...

          POST or PUT depending on the semantic behind the end point you are going to contact. i.e. post should create a new entry (e.g. user, note, whatever it is you handle) and PUT update an existing one (e.g. the first name of a user etc.).

          QNetworkAccessManager should be enough for your needs from your description.

          You can also take a look at the engin.io module for inspiration but currently it might be over engineering for what you want to do.

          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