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. [Solved]How to send text to a website from a Qt desktop application and get back results?

[Solved]How to send text to a website from a Qt desktop application and get back results?

Scheduled Pinned Locked Moved General and Desktop
7 Posts 4 Posters 3.2k 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.
  • O Offline
    O Offline
    ogrishmania
    wrote on last edited by
    #1

    I want to send plain text or html code to a website from a qt desktop application, the website must check it from spam, then retrieve results from website in desktop application.
    How can I do this? I can’t seem to find specific wiki for this (I don’t know what to look for).
    I posted this in Qt Webkit also(mistake?).

    1 Reply Last reply
    0
    • L Offline
      L Offline
      leon.anavi
      wrote on last edited by
      #2

      [quote author="ogrishmania" date="1364056636"]
      How can I do this? I can’t seem to find specific wiki for this (I don’t know what to look for).[/quote]

      Check this simple example for "data download at our Wiki":http://qt-project.org/wiki/Download_Data_from_URL

      [quote author="ogrishmania" date="1364056636"]
      I posted this in Qt Webkit also(mistake?).[/quote]

      Yes, you should avoid duplication. The other thread must be closed.

      http://anavi.org/

      1 Reply Last reply
      0
      • S Offline
        S Offline
        Sashko
        wrote on last edited by
        #3

        You can communicate with your web server via http. You'll need to formulate a http-request in your application and there must be a request-handler on the server side that performs some operation with the payload in your request (spam checking in your case) and sends back a replay.
        Maybe this link can give you some ideas about how to do this:
        :http://www.developer.nokia.com/Community/Wiki/Creating_an_HTTP_network_request_in_Qt

        Check also the documentation of the classes mentioned in that article.

        1 Reply Last reply
        0
        • O Offline
          O Offline
          ogrishmania
          wrote on last edited by
          #4

          But it is not my server or my website. It's a random website that checks email text or html code for spam.
          Let's say I use "this":http://www.emailspamtest.com/# website. I want my app to send some text or html code to the appropriate fields on that webpage and then get the result from the server. Is it possible since it's not my website or my server?

          1 Reply Last reply
          0
          • C Offline
            C Offline
            Code_ReaQtor
            wrote on last edited by
            #5

            [quote author="ogrishmania" date="1364061704"]But it is not my server or my website. It's a random website that checks email text or html code for spam.
            Let's say I use "this":http://www.emailspamtest.com/# website. I want my app to send some text or html code to the appropriate fields on that webpage and then get the result from the server. Is it possible since it's not my website or my server?[/quote]

            You can use QNetworkAccessManager::post().
            I see that the site doesn't have an API but if you try to see the source code of the page, it uses a "form" for submitting data. I think you can use QHttpMultiPart for this, though I don't recommend using it because of some past problems I encountered. I recommend using "FormPost":http://www.tuckdesign.com/sources/Qt

            Please visit my open-source projects at https://github.com/Code-ReaQtor.

            1 Reply Last reply
            0
            • S Offline
              S Offline
              Sashko
              wrote on last edited by
              #6

              [quote author="ogrishmania" date="1364061704"]But it is not my server or my website. It's a random website that checks email text or html code for spam.
              Let's say I use "this":http://www.emailspamtest.com/# website. I want my app to send some text or html code to the appropriate fields on that webpage and then get the result from the server. Is it possible since it's not my website or my server?[/quote]

              I'd rather use a service with a well documented API. A quick search lead me to
              http://spamcheck.postmarkapp.com/doc

              You can use Qt-classes to create such a POST-request and to send it to their request handler (API endpoint, as it called there).

              1 Reply Last reply
              0
              • O Offline
                O Offline
                ogrishmania
                wrote on last edited by
                #7

                Thank you all for the help.

                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