The QNetworkAccessManager class allows the application to send network requests and receive replies. QNetworkAccessManager class which holds the common configuration and settings for the requests it sends
The QTcpSocket class, part of the Qt framework, provides a TCP socket.
Qnetworkaccessmanager is higher level than qhttp and qtcpsocket so they have abstracted away the sockets connection state
How to obtain QNetworkAccessManager's connection states?
This is the blocking way of waiting for a connection to be established instead of connecting to the qtcpsocket connected signal;like yuriy pointed out qnetworkaccessmanager is way more convenient to handle http requests as a client
Bad Request, Your browser sent a request that this server could not understand - Qt Websocket Server