qTbot 0.2.123.6f57966
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>

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

Public Types

enum  RequestMethod { Get , Post , Upload }
 RequestMethod This is the list of supported request types. More...
enum  RequestPriority {
  NoPriority = 0 , LowPriority = 1 , NormalPriority = 2 , HighPriority = 3 ,
  UngeredPriority = 4 , MaxPriorityValue = 0xff
}
 The RequestPriority enum This is the list of request execution priorities on the client side. More...

Public Member Functions

 iRequest ()
 iRequest default constructor.
virtual QString makeUpload () const
 makeUpload This method prepares the data to upload.
virtual QString baseAddress () const =0
 baseAddress This method returns the base domain of the remote server.
virtual RequestMethod method () const =0
 method returns the method of the request.
const QString & request () const
 request Returns the current request command.
void setRequest (const QString &newRequest)
 setRequest sets a custom request command
const QMap< QString, QVariant > & args () const
 args This method returns the the current list of arguments
void addArg (const QString &key, const QVariant &val)
 addArg This method pushes a new argument to the arguments list
void setArgs (const QMap< QString, QVariant > &newArgs)
 setArgs For some requests the list of arguments is possible to build only after the 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.
RequestPriority priority () const
 priority This is the priority of executing this request on the client.
void setPriority (RequestPriority newPriority)
 setPriority This method sets a new priority for the request.

Detailed Description

The iRequest class Is main interface for all custom requests.

See also
IBot::sendRequest

Definition at line 32 of file irequest.h.

Member Enumeration Documentation

◆ RequestMethod

RequestMethod This is the list of supported request types.

Enumerator
Get 

Get general get request, all request data is sent as a url line.

Post 

Post general post request.

Upload 

Upload this is a post request to upload big data to telegram.

Definition at line 43 of file irequest.h.

◆ RequestPriority

The RequestPriority enum This is the list of request execution priorities on the client side.

Enumerator
NoPriority 

NoPriority the request has no priority. It will be executed last.

LowPriority 

LowPriority the request has a low priority.

NormalPriority 

NormalPriority the request has a normal priority. This is the default value.

HighPriority 

HighPriority the request has a high priority.

UngeredPriority 

UngeredPriority the request has an urgent priority. It will be executed first.

MaxPriorityValue 

MaxPriorityValue the maximum value of the priority.

Definition at line 61 of file irequest.h.

Constructor & Destructor Documentation

◆ iRequest()

qTbot::iRequest::iRequest ( )

iRequest default constructor.

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 pushes a new argument to the arguments list

Parameters
keyThis is the new argument key
valThis is the 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 the the current list of arguments

Returns
the 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.

Here is the caller graph for this function:

◆ 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 returns the base domain of the remote server.

Returns
base domain name of the remote server.

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

◆ makeUpload()

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

makeUpload This method prepares the data to upload.

Returns
the data prepared for 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 the method of the request.

Returns
method of the request

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

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

◆ priority()

iRequest::RequestPriority qTbot::iRequest::priority ( ) const

priority This is the priority of executing this request on the client.

Returns
the current request priority.

Definition at line 94 of file irequest.cpp.

Here is the caller graph for this function:

◆ request()

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

request Returns the current request command.

Returns
the current request command.

Definition at line 102 of file irequest.cpp.

Here is the caller graph for this function:

◆ setArgs()

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

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

Parameters
newArgsThis is the new list of arguments.

Definition at line 38 of file irequest.cpp.

Here is the caller graph for this function:

◆ setPriority()

void qTbot::iRequest::setPriority ( RequestPriority newPriority)

setPriority This method sets a new priority for the request.

Parameters
newPriorityThis is the new priority of the request.

Definition at line 98 of file irequest.cpp.

Here is the caller graph for this function:

◆ setRequest()

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

setRequest sets a custom request command

Parameters
newRequestthe new custom command of the request.

Definition at line 106 of file irequest.cpp.

Here is the caller graph for this function:

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