qTbot 0.89.ee6949a
qTbot is base back end library for your c++ Qt projects.
qTbot::iRequest Class Referenceabstract

The iRequest class Is main interface for all custom requests. More...

#include <irequest.h>

Public Types

enum  RequestMethod { Get , Post , Upload }
 RequestMethod Tgis islist of supported requests types of the requests. More...
 

Public Member Functions

 iRequest ()
 
virtual QString makeUpload () const
 makeUpload This method prepare data to upload;
 
virtual QString baseAddress () const =0
 baseAddress This method return base domain of remote server.
 
virtual RequestMethod method () const =0
 method returns method of the request.
 
const QString & request () const
 request return current requests commnad.
 
void setRequest (const QString &newRequest)
 setRequest sets custom requests commnad
 
const QMap< QString, QVariant > & args () const
 args This method returns a current list of arguments
 
void addArg (const QString &key, const QVariant &val)
 addArg This method push new arg, to arguments list
 
void setArgs (const QMap< QString, QVariant > &newArgs)
 setArgs For the some requests list of arguments posible to build only after constructor.
 
QString argsToUrl () const
 argsToUrl This method converts the arguments to a URL string.
 
QSharedPointer< QHttpMultiPart > argsToMultipartFormData () const
 argsToMultipartFormData This method generates multipart/form-data request data.
 

Detailed Description

The iRequest class Is main interface for all custom requests.

See also
IBot::sendRequest

Definition at line 32 of file irequest.h.

Inheritance diagram for qTbot::iRequest:
Inheritance graph
Collaboration diagram for qTbot::iRequest:
Collaboration graph

Member Enumeration Documentation

◆ RequestMethod

RequestMethod Tgis islist of supported requests types of the requests.

Enumerator
Get 

general ger request, all request data sent as a url line

Post 

general post request

Upload 

this is post request to upload a big data to telegram

Definition at line 40 of file irequest.h.

Constructor & Destructor Documentation

◆ iRequest()

qTbot::iRequest::iRequest ( )

Definition at line 15 of file irequest.cpp.

Member Function Documentation

◆ addArg()

void qTbot::iRequest::addArg ( const QString &  key,
const QVariant &  val 
)

addArg This method push new arg, to arguments list

Parameters
keyThis is new argument key
valthis is new argument value.

Definition at line 34 of file irequest.cpp.

Here is the caller graph for this function:

◆ args()

const QMap< QString, QVariant > & qTbot::iRequest::args ( ) const

args This method returns a current list of arguments

Returns
current list of arguments

Definition at line 30 of file irequest.cpp.

Here is the caller graph for this function:

◆ argsToMultipartFormData()

QSharedPointer< QHttpMultiPart > qTbot::iRequest::argsToMultipartFormData ( ) const

argsToMultipartFormData This method generates multipart/form-data request data.

Returns
QHttpMultiPart - A QHttpMultiPart object containing multipart/form-data request data.

Definition at line 58 of file irequest.cpp.

◆ argsToUrl()

QString qTbot::iRequest::argsToUrl ( ) const

argsToUrl This method converts the arguments to a URL string.

Returns
URL string created from the arguments.

Definition at line 42 of file irequest.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ baseAddress()

virtual QString qTbot::iRequest::baseAddress ( ) const
pure virtual

baseAddress This method return base domain of remote server.

Returns
base domain name of remoute server.

Implemented in qTbot::TelegrammDownloadFile, and qTbot::TelegramSingleRquest.

◆ makeUpload()

QString qTbot::iRequest::makeUpload ( ) const
virtual

makeUpload This method prepare data to upload;

Returns
data array prepared to sending.

Definition at line 20 of file irequest.cpp.

Here is the call graph for this function:

◆ method()

virtual RequestMethod qTbot::iRequest::method ( ) const
pure virtual

method returns method of the request.

Returns
method of the request

Implemented in qTbot::TelegramSendFile, and qTbot::TelegramSingleRquest.

Here is the caller graph for this function:

◆ request()

const QString & qTbot::iRequest::request ( ) const

request return current requests commnad.

Returns
current requests commnad.

Definition at line 94 of file irequest.cpp.

Here is the caller graph for this function:

◆ setArgs()

void qTbot::iRequest::setArgs ( const QMap< QString, QVariant > &  newArgs)

setArgs For the some requests list of arguments posible to build only after constructor.

Parameters
newArgsThis is new list of arguments.

Definition at line 38 of file irequest.cpp.

Here is the caller graph for this function:

◆ setRequest()

void qTbot::iRequest::setRequest ( const QString &  newRequest)

setRequest sets custom requests commnad

Parameters
newRequestnew custom commnad of the request.

Definition at line 98 of file irequest.cpp.

Here is the caller graph for this function:

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