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. how can i send a HTTP GET request use Qt?

how can i send a HTTP GET request use Qt?

Scheduled Pinned Locked Moved Unsolved General and Desktop
3 Posts 3 Posters 2.2k Views 2 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.
  • O Offline
    O Offline
    opengpu
    wrote on last edited by
    #1

    how can i send a HTTP GET request use Qt?

    	boost::asio::streambuf request;
    	std::ostream request_stream(&request);
    	request_stream << "GET " << path_ << " HTTP/1.1\r\n";
    	request_stream << "Host: " << server_ << ":" << port_ << "\r\n";
    	request_stream << "Accept: */*\r\n";
    	request_stream << "Connection: close\r\n\r\n";
    
    K Pablo J. RoginaP 2 Replies Last reply
    0
    • O opengpu

      how can i send a HTTP GET request use Qt?

      	boost::asio::streambuf request;
      	std::ostream request_stream(&request);
      	request_stream << "GET " << path_ << " HTTP/1.1\r\n";
      	request_stream << "Host: " << server_ << ":" << port_ << "\r\n";
      	request_stream << "Accept: */*\r\n";
      	request_stream << "Connection: close\r\n\r\n";
      
      K Offline
      K Offline
      koahnig
      wrote on last edited by
      #2

      @opengpu

      Didi you check out the httpexample code https://doc.qt.io/qt-5/qtnetwork-http-example.html ?

      Vote the answer(s) that helped you to solve your issue(s)

      1 Reply Last reply
      4
      • O opengpu

        how can i send a HTTP GET request use Qt?

        	boost::asio::streambuf request;
        	std::ostream request_stream(&request);
        	request_stream << "GET " << path_ << " HTTP/1.1\r\n";
        	request_stream << "Host: " << server_ << ":" << port_ << "\r\n";
        	request_stream << "Accept: */*\r\n";
        	request_stream << "Connection: close\r\n\r\n";
        
        Pablo J. RoginaP Offline
        Pablo J. RoginaP Offline
        Pablo J. Rogina
        wrote on last edited by
        #3

        @opengpu basically networking in Qt centers around classes QNetworkAccessManager, QNetworkRequest and QNetworkReply

        Please check the example suggested by @koahnig since it has mostly everything to grab a very good idea of those classes working together...

        Upvote the answer(s) that helped you solve the issue
        Use "Topic Tools" button to mark your post as Solved
        Add screenshots via postimage.org
        Don't ask support requests via chat/PM. Please use the forum so others can benefit from the solution in the future

        1 Reply Last reply
        3

        • Login

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