12#include "qTbot/global.h"
17#include <QHttpMultiPart>
19#define REQUEST_UPLOAD_FILE_KEY "_file_"
93 virtual QString makeUpload()
const;
111 const QString&
request()
const;
123 const QMap<QString, QVariant> &
args()
const;
130 void addArg(
const QString& key,
const QVariant& val);
136 void setArgs(
const QMap<QString, QVariant> &newArgs);
167 QMap<QString, QVariant> _args;
QString argsToUrl() const
argsToUrl This method converts the arguments to a URL string.
RequestMethod
RequestMethod This is the list of supported request types.
@ Post
Post general post request.
@ Upload
Upload this is a post request to upload big data to telegram.
@ Get
Get general get request, all request data is sent as a url line.
RequestPriority priority() const
priority This is the priority of executing this request on the client.
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
const QString & request() const
request Returns the current request command.
void setArgs(const QMap< QString, QVariant > &newArgs)
setArgs For some requests the list of arguments is possible to build only after the constructor.
void addArg(const QString &key, const QVariant &val)
addArg This method pushes a new argument to the arguments list
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.
iRequest()
iRequest default constructor.
void setPriority(RequestPriority newPriority)
setPriority This method sets a new priority for the request.
RequestPriority
The RequestPriority enum This is the list of request execution priorities on the client side.
@ NoPriority
NoPriority the request has no priority. It will be executed last.
@ HighPriority
HighPriority the request has a high priority.
@ NormalPriority
NormalPriority the request has a normal priority. This is the default value.
@ MaxPriorityValue
MaxPriorityValue the maximum value of the priority.
@ UngeredPriority
UngeredPriority the request has an urgent priority. It will be executed first.
@ LowPriority
LowPriority the request has a low priority.
QSharedPointer< QHttpMultiPart > argsToMultipartFormData() const
argsToMultipartFormData This method generates multipart/form-data request data.
QHash< QString, QSharedPointer< QJsonObject > > ExtraJsonObjects
ExtraJsonObjects hash map of the extra objects of the message.