Qt HTTP-based network programming

HTTP (hypertext transfer protocol Hyper Text Transfer Protocol)

  Based on TCP / IP communication protocol, an application layer protocol.

Usage:

  HTTP is a connectionless (meaning no connection restriction is only one request per connection)

  HTTP is independent (data content as long as the client and the server knows how to handle any type of data can be sent over HTTP) media

  HTTP is a stateless protocol (Stateless means that no protocol for transaction processing and memory. If the lack of state means that the subsequent processing requires previous information)

working principle:

  HTTP protocol works on the client - server architecture on.

  HTTP client (browser) sends all HTTP requests to the server (WEB server) through a URL.

  The default HTTP port number is 80, but you can also be changed to 8080 or other ports.

 

HTTP programming steps:

 

tool:

  Use Qt network module provided QtNetwork;

  Use class QNetworkAccessManager Qt offers, QNetworkRequest, QNetworkReply.

 

Code :( subsequent addition)

Guess you like

Origin www.cnblogs.com/citrus/p/11835852.html