As Orangepill and PLB said, the solution is Passing cookies to the request url
, you may refer to QNetworkAccessManager::setCookieJar
.
Steps
- Instantiate the
QNetworkAccessManager
object and callsetCookieJar
for it. - Send POST request to the authenticate page which activates a session. Then you will have cookies got from the page in the
cookieJar
. - Send requests to the pages under the domain will with the session alive.