qTbot 0.87.9547b0c
qTbot is base back end library for your c++ Qt projects.
qTbot::TelegramSingleRquest Class Reference

The TelegramSingleRquest class Is base class for all single requests commands with arguments. More...

#include <telegramsinglerquest.h>

Public Member Functions

 TelegramSingleRquest (const QString &request, const QMap< QString, QVariant > &args)
 TelegramSingleRquest This main constructor of the single requests.
 
 TelegramSingleRquest (const QString &request)
 TelegramSingleRquest This main constructor of the single requests.
 
QString baseAddress () const override
 baseAddress This method return base domain of remote server.
 
RequestMethod method () const override
 method returns method of the request.
 
- Public Member Functions inherited from qTbot::iRequest
 iRequest ()
 
virtual QString makeUpload () const
 makeUpload This method prepare data to upload;
 
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.
 

Additional Inherited Members

- Public Types inherited from qTbot::iRequest
enum  RequestMethod { Get , Post , Upload }
 RequestMethod Tgis islist of supported requests types of the requests. More...
 

Detailed Description

The TelegramSingleRquest class Is base class for all single requests commands with arguments.

Example: create a single request to telegram server.

#include "qTbot/messages/telegramsinglerquest.h"
class QTBOT_EXPORT TelegramGetMsg final: public TelegramSingleRquest
{
public:
TelegramGetMsg();
};
TelegramGetMsg::TelegramGetMsg(int arg1):TelegramSingleRquest("getMe", {{"arg1", arg1}}) {}
The TelegramSingleRquest class Is base class for all single requests commands with arguments.
#define QTBOT_EXPORT
Definition global.h:18

Definition at line 36 of file telegramsinglerquest.h.

Inheritance diagram for qTbot::TelegramSingleRquest:
Inheritance graph
Collaboration diagram for qTbot::TelegramSingleRquest:
Collaboration graph

Constructor & Destructor Documentation

◆ TelegramSingleRquest() [1/2]

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

TelegramSingleRquest This main constructor of the single requests.

Parameters
requestThis is request name (command)
argsThis is list of the request arguments.

Definition at line 17 of file telegramsinglerquest.cpp.

Here is the call graph for this function:

◆ TelegramSingleRquest() [2/2]

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

TelegramSingleRquest This main constructor of the single requests.

Parameters
requestThis is request name (command)

Definition at line 23 of file telegramsinglerquest.cpp.

Here is the call graph for this function:

Member Function Documentation

◆ baseAddress()

QString qTbot::TelegramSingleRquest::baseAddress ( ) const
overridevirtual

baseAddress This method return base domain of remote server.

Returns
base domain name of remoute server.

Implements qTbot::iRequest.

Definition at line 27 of file telegramsinglerquest.cpp.

◆ method()

iRequest::RequestMethod qTbot::TelegramSingleRquest::method ( ) const
overridevirtual

method returns method of the request.

Returns
method of the request

Implements qTbot::iRequest.

Definition at line 31 of file telegramsinglerquest.cpp.


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