TreeFrogFramework  2.8
Public Member Functions | List of all members
THttpClient Class Reference

#include <thttpclient.h>

Public Member Functions

 THttpClient ()
 
 ~THttpClient ()
 
QNetworkReply * get (const QUrl &url, int msecs=5000)
 
QNetworkReply * get (const QNetworkRequest &request, int msecs=5000)
 
QNetworkReply * post (const QUrl &url, const QJsonDocument &json, int msecs=5000)
 
QNetworkReply * post (const QNetworkRequest &request, const QByteArray &data, int msecs=5000)
 
QNetworkReply * put (const QUrl &url, const QJsonDocument &json, int msecs=5000)
 
QNetworkReply * put (const QNetworkRequest &request, const QByteArray &data, int msecs=5000)
 
QNetworkReply * deleteResource (const QUrl &url, int msecs=5000)
 
QNetworkReply * deleteResource (const QNetworkRequest &request, int msecs=5000)
 
QNetworkAccessManager * manager ()
 

Detailed Description

The THttpClient class can send HTTP requests to another server and receive replies.

See also
https://doc.qt.io/qt-5/qnetworkaccessmanager.html

Constructor & Destructor Documentation

◆ THttpClient()

THttpClient::THttpClient ( )

◆ ~THttpClient()

THttpClient::~THttpClient ( )

Member Function Documentation

◆ deleteResource() [1/2]

QNetworkReply * THttpClient::deleteResource ( const QNetworkRequest &  request,
int  msecs = 5000 
)

Sends a request to delete the resource identified by the URL of request.

◆ deleteResource() [2/2]

QNetworkReply * THttpClient::deleteResource ( const QUrl &  url,
int  msecs = 5000 
)

Sends a request to delete the resource identified by the URL url.

◆ get() [1/2]

QNetworkReply * THttpClient::get ( const QNetworkRequest &  request,
int  msecs = 5000 
)

Posts a request to obtain the contents of the target request and returns a new QNetworkReply object opened for reading.

◆ get() [2/2]

QNetworkReply * THttpClient::get ( const QUrl &  url,
int  msecs = 5000 
)

Posts a request to obtain the contents of the target request and returns a new QNetworkReply object opened for reading.

◆ manager()

QNetworkAccessManager* THttpClient::manager ( )
inline

◆ post() [1/2]

QNetworkReply * THttpClient::post ( const QNetworkRequest &  request,
const QByteArray &  data,
int  msecs = 5000 
)

Sends an HTTP POST request to the destination specified by request and returns a new QNetworkReply object opened for reading.

◆ post() [2/2]

QNetworkReply * THttpClient::post ( const QUrl &  url,
const QJsonDocument &  json,
int  msecs = 5000 
)

Sends an HTTP POST request to the destination specified by url and returns a new QNetworkReply object opened for reading.

◆ put() [1/2]

QNetworkReply * THttpClient::put ( const QNetworkRequest &  request,
const QByteArray &  data,
int  msecs = 5000 
)

Uploads the contents of data to the destination request and returns a new QNetworkReply object that will be open for reply.

◆ put() [2/2]

QNetworkReply * THttpClient::put ( const QUrl &  url,
const QJsonDocument &  json,
int  msecs = 5000 
)

Uploads the contents of json to the destination url and returns a new QNetworkReply object that will be open for reply.


The documentation for this class was generated from the following files: