HyperText Transfer Protocol (HTTP) is the protocol on which the World Wide Web is built, and arguably the most important communications protocol of our time. We could certainly implement our own HTTP communications on top of sockets, but Qt has already done the work for us. The QNetworkAccessManager class implements an object that can transmit HTTP requests and receive HTTP replies. We can use this class to create applications that communicate with web services and APIs.
HTTP communications with QNetworkAccessManager
Simple downloading
To demonstrate the basic use of QNetworkAccessManager, we're going to build a simple command-line HTTP download tool. Open a blank file called downloader.py and let's start with some...