QtRestClient  3.0.0
A library for generic JSON-based REST-APIs, with a mechanism to map JSON to Qt objects
Public Member Functions | Static Public Attributes | List of all members
QtRestClient::RestClass Class Reference

A class to perform requests to an API. More...

#include <restclass.h>

+ Inheritance diagram for QtRestClient::RestClass:

Public Member Functions

RestClientclient () const
 Returns the rest client this class operates with.
 
RestClasssubClass (const QString &path, QObject *parent=nullptr) const
 Creates a new rest class based on this one for the given path and parent.
 
virtual RequestBuilder builder () const
 Creates a request builder for this class. More...
 
RestReplycallRaw (const QByteArray &verb, const QString &methodPath, const QVariantHash &parameters={}, const HeaderHash &headers={}, bool paramsAsBody=false) const
 Performs a API call of the given verb with CBOR or JSON data. More...
 
RestReplycallRaw (const QByteArray &verb, const QString &methodPath, const QCborValue &body, const QVariantHash &parameters={}, const HeaderHash &headers={}) const
 Performs a API call of the given verb with CBOR or JSON data. More...
 
RestReplycallRaw (const QByteArray &verb, const QString &methodPath, const QJsonValue &body, const QVariantHash &parameters={}, const HeaderHash &headers={}) const
 Performs a API call of the given verb with CBOR or JSON data. More...
 
RestReplycallRaw (const QByteArray &verb, const QVariantHash &parameters={}, const HeaderHash &headers={}, bool paramsAsBody=false) const
 Performs a API call of the given verb with CBOR or JSON data. More...
 
RestReplycallRaw (const QByteArray &verb, const QCborValue &body, const QVariantHash &parameters={}, const HeaderHash &headers={}) const
 Performs a API call of the given verb with CBOR or JSON data. More...
 
RestReplycallRaw (const QByteArray &verb, const QJsonValue &body, const QVariantHash &parameters={}, const HeaderHash &headers={}) const
 Performs a API call of the given verb with CBOR or JSON data. More...
 
RestReplycallRaw (const QByteArray &verb, const QUrl &relativeUrl, const QVariantHash &parameters={}, const HeaderHash &headers={}, bool paramsAsBody=false) const
 Performs a API call of the given verb with CBOR or JSON data. More...
 
RestReplycallRaw (const QByteArray &verb, const QUrl &relativeUrl, const QCborValue &body, const QVariantHash &parameters={}, const HeaderHash &headers={}) const
 Performs a API call of the given verb with CBOR or JSON data. More...
 
RestReplycallRaw (const QByteArray &verb, const QUrl &relativeUrl, const QJsonValue &body, const QVariantHash &parameters={}, const HeaderHash &headers={}) const
 Performs a API call of the given verb with CBOR or JSON data. More...
 
template<typename DT = QObject*, typename ET = QObject*>
GenericRestReply< DT, ET > * call (const QByteArray &verb, const QString &methodPath, const QVariantHash &parameters={}, const HeaderHash &headers={}, bool paramsAsBody=false) const
 Performs an API call of the given verb with generic objects. More...
 
template<typename DT = QObject*, typename ET = QObject*, typename RO = QObject*>
GenericRestReply< DT, ET > * call (const QByteArray &verb, const QString &methodPath, const RO &body, const QVariantHash &parameters={}, const HeaderHash &headers={}) const
 Performs an API call of the given verb with generic objects. More...
 
template<typename DT = QObject*, typename ET = QObject*>
GenericRestReply< DT, ET > * call (const QByteArray &verb, const QVariantHash &parameters={}, const HeaderHash &headers={}, bool paramsAsBody=false) const
 Performs an API call of the given verb with generic objects. More...
 
template<typename DT = QObject*, typename ET = QObject*, typename RO = QObject*>
GenericRestReply< DT, ET > * call (const QByteArray &verb, const RO &body, const QVariantHash &parameters={}, const HeaderHash &headers={}) const
 Performs an API call of the given verb with generic objects. More...
 
template<typename DT = QObject*, typename ET = QObject*>
GenericRestReply< DT, ET > * call (const QByteArray &verb, const QUrl &relativeUrl, const QVariantHash &parameters={}, const HeaderHash &headers={}, bool paramsAsBody=false) const
 Performs an API call of the given verb with generic objects. More...
 
template<typename DT = QObject*, typename ET = QObject*, typename RO = QObject*>
GenericRestReply< DT, ET > * call (const QByteArray &verb, const QUrl &relativeUrl, const RO &body, const QVariantHash &parameters={}, const HeaderHash &headers={}) const
 Performs an API call of the given verb with generic objects. More...
 
template<typename DT = QObject*, typename ET = QObject*>
GenericRestReply< DT, ET > * get (const QString &methodPath, const QVariantHash &parameters={}, const HeaderHash &headers={}) const
 Performs GET-request with generic objects. More...
 
template<typename DT = QObject*, typename ET = QObject*>
GenericRestReply< DT, ET > * get (const QVariantHash &parameters={}, const HeaderHash &headers={}) const
 Performs GET-request with generic objects. More...
 
template<typename DT = QObject*, typename ET = QObject*>
GenericRestReply< DT, ET > * get (const QUrl &relativeUrl, const QVariantHash &parameters={}, const HeaderHash &headers={}) const
 Performs GET-request with generic objects. More...
 
template<typename DT = QObject*, typename ET = QObject*>
GenericRestReply< DT, ET > * post (const QString &methodPath, const QVariantHash &parameters={}, const HeaderHash &headers={}) const
 Performs POST-request with generic objects. More...
 
template<typename DT = QObject*, typename ET = QObject*, typename RO = QObject*>
GenericRestReply< DT, ET > * post (const QString &methodPath, const RO &body, const HeaderHash &headers={}) const
 Performs POST-request with generic objects. More...
 
template<typename DT = QObject*, typename ET = QObject*>
GenericRestReply< DT, ET > * post (const QVariantHash &parameters={}, const HeaderHash &headers={}) const
 Performs POST-request with generic objects. More...
 
template<typename DT = QObject*, typename ET = QObject*, typename RO = QObject*>
GenericRestReply< DT, ET > * post (const RO &body, const HeaderHash &headers={}) const
 Performs POST-request with generic objects. More...
 
template<typename DT = QObject*, typename ET = QObject*>
GenericRestReply< DT, ET > * post (const QUrl &relativeUrl, const QVariantHash &parameters={}, const HeaderHash &headers={}) const
 Performs POST-request with generic objects. More...
 
template<typename DT = QObject*, typename ET = QObject*, typename RO = QObject*>
GenericRestReply< DT, ET > * post (const QUrl &relativeUrl, const RO &body, const HeaderHash &headers={}) const
 Performs POST-request with generic objects. More...
 
template<typename DT = QObject*, typename ET = QObject*, typename RO = QObject*>
GenericRestReply< DT, ET > * put (const QString &methodPath, const RO &body, const QVariantHash &parameters={}, const HeaderHash &headers={}) const
 Performs PUT-request with generic objects. More...
 
template<typename DT = QObject*, typename ET = QObject*, typename RO = QObject*>
GenericRestReply< DT, ET > * put (const RO &body, const QVariantHash &parameters={}, const HeaderHash &headers={}) const
 Performs PUT-request with generic objects. More...
 
template<typename DT = QObject*, typename ET = QObject*, typename RO = QObject*>
GenericRestReply< DT, ET > * put (const QUrl &relativeUrl, const RO &body, const QVariantHash &parameters={}, const HeaderHash &headers={}) const
 Performs PUT-request with generic objects. More...
 
template<typename DT = QObject*, typename ET = QObject*>
GenericRestReply< DT, ET > * deleteResource (const QString &methodPath, const QVariantHash &parameters={}, const HeaderHash &headers={}) const
 Performs DELETE-request with generic objects. More...
 
template<typename DT = QObject*, typename ET = QObject*>
GenericRestReply< DT, ET > * deleteResource (const QVariantHash &parameters={}, const HeaderHash &headers={}) const
 Performs DELETE-request with generic objects. More...
 
template<typename DT = QObject*, typename ET = QObject*>
GenericRestReply< DT, ET > * deleteResource (const QUrl &relativeUrl, const QVariantHash &parameters={}, const HeaderHash &headers={}) const
 Performs DELETE-request with generic objects. More...
 
template<typename DT = QObject*, typename ET = QObject*, typename RO = QObject*>
GenericRestReply< DT, ET > * patch (const QString &methodPath, const RO &body, const QVariantHash &parameters={}, const HeaderHash &headers={}) const
 Performs PATCH-request with generic objects. More...
 
template<typename DT = QObject*, typename ET = QObject*, typename RO = QObject*>
GenericRestReply< DT, ET > * patch (const RO &body, const QVariantHash &parameters={}, const HeaderHash &headers={}) const
 Performs PATCH-request with generic objects. More...
 
template<typename DT = QObject*, typename ET = QObject*, typename RO = QObject*>
GenericRestReply< DT, ET > * patch (const QUrl &relativeUrl, const RO &body, const QVariantHash &parameters={}, const HeaderHash &headers={}) const
 Performs PATCH-request with generic objects. More...
 
template<typename DT = QObject*, typename ET = QObject*>
GenericRestReply< DT, ET > * head (const QString &methodPath, const QVariantHash &parameters={}, const HeaderHash &headers={}) const
 Performs HEAD-request with generic objects. More...
 
template<typename DT = QObject*, typename ET = QObject*>
GenericRestReply< DT, ET > * head (const QVariantHash &parameters={}, const HeaderHash &headers={}) const
 Performs HEAD-request with generic objects. More...
 
template<typename DT = QObject*, typename ET = QObject*>
GenericRestReply< DT, ET > * head (const QUrl &relativeUrl, const QVariantHash &parameters={}, const HeaderHash &headers={}) const
 Performs HEAD-request with generic objects. More...
 
- Public Member Functions inherited from QObject
virtual const QMetaObjectmetaObject () const const
 
 QObject (QObject *parent)
 
virtual bool event (QEvent *e)
 
virtual bool eventFilter (QObject *watched, QEvent *event)
 
QString objectName () const const
 
void setObjectName (const QString &name)
 
bool isWidgetType () const const
 
bool isWindowType () const const
 
bool signalsBlocked () const const
 
bool blockSignals (bool block)
 
QThreadthread () const const
 
void moveToThread (QThread *targetThread)
 
int startTimer (int interval, Qt::TimerType timerType)
 
int startTimer (std::chrono::milliseconds time, Qt::TimerType timerType)
 
void killTimer (int id)
 
findChild (const QString &name, Qt::FindChildOptions options) const const
 
QList< T > findChildren (const QString &name, Qt::FindChildOptions options) const const
 
QList< T > findChildren (const QRegExp &regExp, Qt::FindChildOptions options) const const
 
QList< T > findChildren (const QRegularExpression &re, Qt::FindChildOptions options) const const
 
const QObjectListchildren () const const
 
void setParent (QObject *parent)
 
void installEventFilter (QObject *filterObj)
 
void removeEventFilter (QObject *obj)
 
QMetaObject::Connection connect (const QObject *sender, const char *signal, const char *method, Qt::ConnectionType type) const const
 
bool disconnect (const char *signal, const QObject *receiver, const char *method) const const
 
bool disconnect (const QObject *receiver, const char *method) const const
 
void dumpObjectTree ()
 
void dumpObjectInfo ()
 
void dumpObjectTree () const const
 
void dumpObjectInfo () const const
 
bool setProperty (const char *name, const QVariant &value)
 
QVariant property (const char *name) const const
 
QList< QByteArraydynamicPropertyNames () const const
 
void destroyed (QObject *obj)
 
void objectNameChanged (const QString &objectName)
 
QObjectparent () const const
 
bool inherits (const char *className) const const
 
void deleteLater ()
 
 Q_DISABLE_COPY (Class)
 
 Q_DISABLE_MOVE (Class)
 
 Q_DISABLE_COPY_MOVE (Class)
 
qobject_cast (QObject *object)
 
qobject_cast (const QObject *object)
 
qFindChild (const QObject *obj, const QString &name)
 
QList< T > qFindChildren (const QObject *obj, const QString &name)
 
QList< T > qFindChildren (const QObject *obj, const QRegExp &regExp)
 
 Q_CLASSINFO (Name, Value)
 
 Q_INTERFACES (...)
 
 Q_PROPERTY (...)
 
 Q_ENUMS (...)
 
 Q_FLAGS (...)
 
 Q_ENUM (...)
 
 Q_FLAG (...)
 
 Q_ENUM_NS (...)
 
 Q_FLAG_NS (...)
 
 Q_OBJECT Q_OBJECT
 
 Q_GADGET Q_GADGET
 
 Q_NAMESPACE Q_NAMESPACE
 
 Q_SIGNALS Q_SIGNALS
 
 Q_SIGNAL Q_SIGNAL
 
 Q_SLOTS Q_SLOTS
 
 Q_SLOT Q_SLOT
 
 Q_EMIT Q_EMIT
 
 Q_INVOKABLE Q_INVOKABLE
 
 Q_REVISION Q_REVISION
 
 Q_SET_OBJECT_NAME (Object)
 
 QT_NO_NARROWING_CONVERSIONS_IN_CONNECT QT_NO_NARROWING_CONVERSIONS_IN_CONNECT
 

Static Public Member Functions

static QVariantHash concatParams ()
 A generic method to concatenate parameters into a QVariantHash. More...
 
template<typename... Args>
static QVariantHash concatParams (const QString &key, const QVariant &value, Args... parameters)
 A generic method to concatenate parameters into a QVariantHash. More...
 
- Static Public Member Functions inherited from QObject
QString tr (const char *sourceText, const char *disambiguation, int n)
 
QString trUtf8 (const char *sourceText, const char *disambiguation, int n)
 
QMetaObject::Connection connect (const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
 
QMetaObject::Connection connect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method, Qt::ConnectionType type)
 
QMetaObject::Connection connect (const QObject *sender, PointerToMemberFunction signal, const QObject *receiver, PointerToMemberFunction method, Qt::ConnectionType type)
 
QMetaObject::Connection connect (const QObject *sender, PointerToMemberFunction signal, Functor functor)
 
QMetaObject::Connection connect (const QObject *sender, PointerToMemberFunction signal, const QObject *context, Functor functor, Qt::ConnectionType type)
 
bool disconnect (const QObject *sender, const char *signal, const QObject *receiver, const char *method)
 
bool disconnect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method)
 
bool disconnect (const QMetaObject::Connection &connection)
 
bool disconnect (const QObject *sender, PointerToMemberFunction signal, const QObject *receiver, PointerToMemberFunction method)
 

Static Public Attributes

static const QByteArray GetVerb
 A constant for the HTTP-GET verb.
 
static const QByteArray PostVerb
 A constant for the HTTP-POST verb.
 
static const QByteArray PutVerb
 A constant for the HTTP-PUT verb.
 
static const QByteArray DeleteVerb
 A constant for the HTTP-DELETE verb.
 
static const QByteArray PatchVerb
 A constant for the HTTP-PATCH verb.
 
static const QByteArray HeadVerb
 A constant for the HTTP-HEAD verb.
 

Additional Inherited Members

- Public Attributes inherited from QObject
typedef QObjectList
 
- Protected Member Functions inherited from QObject
QObjectsender () const const
 
int senderSignalIndex () const const
 
int receivers (const char *signal) const const
 
bool isSignalConnected (const QMetaMethod &signal) const const
 
virtual void timerEvent (QTimerEvent *event)
 
virtual void childEvent (QChildEvent *event)
 
virtual void customEvent (QEvent *event)
 
virtual void connectNotify (const QMetaMethod &signal)
 
virtual void disconnectNotify (const QMetaMethod &signal)
 
- Properties inherited from QObject
 objectName
 

Detailed Description

A class to perform requests to an API.

Definition at line 19 of file restclass.h.

Member Function Documentation

◆ builder()

QtRestClient::RestClass::builder ( ) const
virtual

Creates a request builder for this class.

Returns
A request builder, prepared with all the settings of the parent rest client and this class

This builder simply adds the classes path to the builder of it's client.

If you need to set additional properties on the builder, that are not provided by the rest client you use , you can override this function. To preserve all the properties override as follows:

RequestBuilder MyClass::builder() const override {
.set...
}
See also
RestClient::builder

◆ call() [1/6]

template<typename DT , typename ET >
QtRestClient::RestClass::call ( const QByteArray verb,
const QString methodPath,
const QVariantHash &  parameters = {},
const HeaderHash headers = {},
bool  paramsAsBody = false 
) const

Performs an API call of the given verb with generic objects.

Note
Not all parameters may apply to all overloads - choose the matching ones
Template Parameters
DTThe expected type of the reply to this request. Defaults to QObject*
ETA type to be used for replies with an error. Defaults to QObject*
ROThe type of the data specified with the body parameter
Parameters
verbThe HTTP-Verb to be used for the request
methodPath(optional) The path to added to the classes base URL
relativeUrl(optional) A URL to be resolved relative to the classes base URL, use as URl for the request
body(optional) The body object to be sent together with the request
parametersA collection of query parameters to be added to the request URL
headersAdditional HTTP-headers to be added to the request
paramsAsBody(optional) Pass the parameters as POST-parameter method body instead of as a query url parametery
Returns
A generic reply object for DT and ET, to handle the reply to this request
Exceptions
QJsonSerializationExceptionWill be thrown, if the body cannot be serializer to JSON

This basic version allows to perform genric calls and replies. The following table shows, how the different path arguments can be used. The class base URL is http://api.example.com/test for this example:

Parameter value requets URL
none http://api.example.com/test
methodPath myPath http://api.example.com/test/myPath
relativeUrl ../prod http://api.example.com/prod

The body type RO must be a serializable object type, i.e. Inherit QObject and be a pointer, or have the Q_GADGET macro. For the list overload, simply types are allowed as well. The reason is: whatever the result of the serialization is, it must be either a json object or a json array.

The same applies for DT and ET, for the reply.

See also
RestClass::callJson(QByteArray, const QString &, const QVariantHash &, const HeaderHash &), https://skycoder42.github.io/QJsonSerializer

Definition at line 233 of file restclass.h.

◆ call() [2/6]

template<typename DT , typename ET , typename RO >
GenericRestReply< DT, ET > * QtRestClient::RestClass::call ( const QByteArray verb,
const QString methodPath,
const RO &  body,
const QVariantHash &  parameters = {},
const HeaderHash headers = {} 
) const

Performs an API call of the given verb with generic objects.

Note
Not all parameters may apply to all overloads - choose the matching ones
Template Parameters
DTThe expected type of the reply to this request. Defaults to QObject*
ETA type to be used for replies with an error. Defaults to QObject*
ROThe type of the data specified with the body parameter
Parameters
verbThe HTTP-Verb to be used for the request
methodPath(optional) The path to added to the classes base URL
relativeUrl(optional) A URL to be resolved relative to the classes base URL, use as URl for the request
body(optional) The body object to be sent together with the request
parametersA collection of query parameters to be added to the request URL
headersAdditional HTTP-headers to be added to the request
paramsAsBody(optional) Pass the parameters as POST-parameter method body instead of as a query url parametery
Returns
A generic reply object for DT and ET, to handle the reply to this request
Exceptions
QJsonSerializationExceptionWill be thrown, if the body cannot be serializer to JSON

This basic version allows to perform genric calls and replies. The following table shows, how the different path arguments can be used. The class base URL is http://api.example.com/test for this example:

Parameter value requets URL
none http://api.example.com/test
methodPath myPath http://api.example.com/test/myPath
relativeUrl ../prod http://api.example.com/prod

The body type RO must be a serializable object type, i.e. Inherit QObject and be a pointer, or have the Q_GADGET macro. For the list overload, simply types are allowed as well. The reason is: whatever the result of the serialization is, it must be either a json object or a json array.

The same applies for DT and ET, for the reply.

See also
RestClass::callJson(QByteArray, const QString &, const QVariantHash &, const HeaderHash &), https://skycoder42.github.io/QJsonSerializer

Definition at line 241 of file restclass.h.

◆ call() [3/6]

template<typename DT , typename ET >
GenericRestReply< DT, ET > * QtRestClient::RestClass::call ( const QByteArray verb,
const QUrl relativeUrl,
const QVariantHash &  parameters = {},
const HeaderHash headers = {},
bool  paramsAsBody = false 
) const

Performs an API call of the given verb with generic objects.

Note
Not all parameters may apply to all overloads - choose the matching ones
Template Parameters
DTThe expected type of the reply to this request. Defaults to QObject*
ETA type to be used for replies with an error. Defaults to QObject*
ROThe type of the data specified with the body parameter
Parameters
verbThe HTTP-Verb to be used for the request
methodPath(optional) The path to added to the classes base URL
relativeUrl(optional) A URL to be resolved relative to the classes base URL, use as URl for the request
body(optional) The body object to be sent together with the request
parametersA collection of query parameters to be added to the request URL
headersAdditional HTTP-headers to be added to the request
paramsAsBody(optional) Pass the parameters as POST-parameter method body instead of as a query url parametery
Returns
A generic reply object for DT and ET, to handle the reply to this request
Exceptions
QJsonSerializationExceptionWill be thrown, if the body cannot be serializer to JSON

This basic version allows to perform genric calls and replies. The following table shows, how the different path arguments can be used. The class base URL is http://api.example.com/test for this example:

Parameter value requets URL
none http://api.example.com/test
methodPath myPath http://api.example.com/test/myPath
relativeUrl ../prod http://api.example.com/prod

The body type RO must be a serializable object type, i.e. Inherit QObject and be a pointer, or have the Q_GADGET macro. For the list overload, simply types are allowed as well. The reason is: whatever the result of the serialization is, it must be either a json object or a json array.

The same applies for DT and ET, for the reply.

See also
RestClass::callJson(QByteArray, const QString &, const QVariantHash &, const HeaderHash &), https://skycoder42.github.io/QJsonSerializer

Definition at line 269 of file restclass.h.

◆ call() [4/6]

template<typename DT , typename ET , typename RO >
GenericRestReply< DT, ET > * QtRestClient::RestClass::call ( const QByteArray verb,
const QUrl relativeUrl,
const RO &  body,
const QVariantHash &  parameters = {},
const HeaderHash headers = {} 
) const

Performs an API call of the given verb with generic objects.

Note
Not all parameters may apply to all overloads - choose the matching ones
Template Parameters
DTThe expected type of the reply to this request. Defaults to QObject*
ETA type to be used for replies with an error. Defaults to QObject*
ROThe type of the data specified with the body parameter
Parameters
verbThe HTTP-Verb to be used for the request
methodPath(optional) The path to added to the classes base URL
relativeUrl(optional) A URL to be resolved relative to the classes base URL, use as URl for the request
body(optional) The body object to be sent together with the request
parametersA collection of query parameters to be added to the request URL
headersAdditional HTTP-headers to be added to the request
paramsAsBody(optional) Pass the parameters as POST-parameter method body instead of as a query url parametery
Returns
A generic reply object for DT and ET, to handle the reply to this request
Exceptions
QJsonSerializationExceptionWill be thrown, if the body cannot be serializer to JSON

This basic version allows to perform genric calls and replies. The following table shows, how the different path arguments can be used. The class base URL is http://api.example.com/test for this example:

Parameter value requets URL
none http://api.example.com/test
methodPath myPath http://api.example.com/test/myPath
relativeUrl ../prod http://api.example.com/prod

The body type RO must be a serializable object type, i.e. Inherit QObject and be a pointer, or have the Q_GADGET macro. For the list overload, simply types are allowed as well. The reason is: whatever the result of the serialization is, it must be either a json object or a json array.

The same applies for DT and ET, for the reply.

See also
RestClass::callJson(QByteArray, const QString &, const QVariantHash &, const HeaderHash &), https://skycoder42.github.io/QJsonSerializer

Definition at line 277 of file restclass.h.

◆ call() [5/6]

template<typename DT , typename ET >
GenericRestReply< DT, ET > * QtRestClient::RestClass::call ( const QByteArray verb,
const QVariantHash &  parameters = {},
const HeaderHash headers = {},
bool  paramsAsBody = false 
) const

Performs an API call of the given verb with generic objects.

Note
Not all parameters may apply to all overloads - choose the matching ones
Template Parameters
DTThe expected type of the reply to this request. Defaults to QObject*
ETA type to be used for replies with an error. Defaults to QObject*
ROThe type of the data specified with the body parameter
Parameters
verbThe HTTP-Verb to be used for the request
methodPath(optional) The path to added to the classes base URL
relativeUrl(optional) A URL to be resolved relative to the classes base URL, use as URl for the request
body(optional) The body object to be sent together with the request
parametersA collection of query parameters to be added to the request URL
headersAdditional HTTP-headers to be added to the request
paramsAsBody(optional) Pass the parameters as POST-parameter method body instead of as a query url parametery
Returns
A generic reply object for DT and ET, to handle the reply to this request
Exceptions
QJsonSerializationExceptionWill be thrown, if the body cannot be serializer to JSON

This basic version allows to perform genric calls and replies. The following table shows, how the different path arguments can be used. The class base URL is http://api.example.com/test for this example:

Parameter value requets URL
none http://api.example.com/test
methodPath myPath http://api.example.com/test/myPath
relativeUrl ../prod http://api.example.com/prod

The body type RO must be a serializable object type, i.e. Inherit QObject and be a pointer, or have the Q_GADGET macro. For the list overload, simply types are allowed as well. The reason is: whatever the result of the serialization is, it must be either a json object or a json array.

The same applies for DT and ET, for the reply.

See also
RestClass::callJson(QByteArray, const QString &, const QVariantHash &, const HeaderHash &), https://skycoder42.github.io/QJsonSerializer

Definition at line 251 of file restclass.h.

◆ call() [6/6]

template<typename DT , typename ET , typename RO >
GenericRestReply< DT, ET > * QtRestClient::RestClass::call ( const QByteArray verb,
const RO &  body,
const QVariantHash &  parameters = {},
const HeaderHash headers = {} 
) const

Performs an API call of the given verb with generic objects.

Note
Not all parameters may apply to all overloads - choose the matching ones
Template Parameters
DTThe expected type of the reply to this request. Defaults to QObject*
ETA type to be used for replies with an error. Defaults to QObject*
ROThe type of the data specified with the body parameter
Parameters
verbThe HTTP-Verb to be used for the request
methodPath(optional) The path to added to the classes base URL
relativeUrl(optional) A URL to be resolved relative to the classes base URL, use as URl for the request
body(optional) The body object to be sent together with the request
parametersA collection of query parameters to be added to the request URL
headersAdditional HTTP-headers to be added to the request
paramsAsBody(optional) Pass the parameters as POST-parameter method body instead of as a query url parametery
Returns
A generic reply object for DT and ET, to handle the reply to this request
Exceptions
QJsonSerializationExceptionWill be thrown, if the body cannot be serializer to JSON

This basic version allows to perform genric calls and replies. The following table shows, how the different path arguments can be used. The class base URL is http://api.example.com/test for this example:

Parameter value requets URL
none http://api.example.com/test
methodPath myPath http://api.example.com/test/myPath
relativeUrl ../prod http://api.example.com/prod

The body type RO must be a serializable object type, i.e. Inherit QObject and be a pointer, or have the Q_GADGET macro. For the list overload, simply types are allowed as well. The reason is: whatever the result of the serialization is, it must be either a json object or a json array.

The same applies for DT and ET, for the reply.

See also
RestClass::callJson(QByteArray, const QString &, const QVariantHash &, const HeaderHash &), https://skycoder42.github.io/QJsonSerializer

Definition at line 259 of file restclass.h.

◆ callRaw() [1/9]

RestReply* QtRestClient::RestClass::callRaw ( const QByteArray verb,
const QCborValue body,
const QVariantHash &  parameters = {},
const HeaderHash headers = {} 
) const

Performs a API call of the given verb with CBOR or JSON data.

Note
Not all parameters may apply to all overloads - choose the matching ones
Parameters
verbThe HTTP-Verb to be used for the request
methodPath(optional) The path to added to the classes base URL
relativeUrl(optional) A URL to be resolved relative to the classes base URL, use as URl for the request
body(optional) The CBOR/JSON body to be sent together with the request
parametersA collection of query parameters to be added to the request URL
headersAdditional HTTP-headers to be added to the request
paramsAsBody(optional) Pass the parameters as POST-parameter method body instead of as a query url parametery
Returns
A reply object, to handle the reply to this request

This basic version allows to perform low-level CBOR/JSON calls and replies. The following table shows, how the different path arguments can be used. The class base URL is http://api.example.com/test for this example:

Parameter value requets URL
none http://api.example.com/test
methodPath myPath http://api.example.com/test/myPath
relativeUrl ../prod http://api.example.com/prod
See also
RestClass::call(QByteArray, const QString &, const QVariantHash &, const HeaderHash &)

◆ callRaw() [2/9]

RestReply* QtRestClient::RestClass::callRaw ( const QByteArray verb,
const QJsonValue body,
const QVariantHash &  parameters = {},
const HeaderHash headers = {} 
) const

Performs a API call of the given verb with CBOR or JSON data.

Note
Not all parameters may apply to all overloads - choose the matching ones
Parameters
verbThe HTTP-Verb to be used for the request
methodPath(optional) The path to added to the classes base URL
relativeUrl(optional) A URL to be resolved relative to the classes base URL, use as URl for the request
body(optional) The CBOR/JSON body to be sent together with the request
parametersA collection of query parameters to be added to the request URL
headersAdditional HTTP-headers to be added to the request
paramsAsBody(optional) Pass the parameters as POST-parameter method body instead of as a query url parametery
Returns
A reply object, to handle the reply to this request

This basic version allows to perform low-level CBOR/JSON calls and replies. The following table shows, how the different path arguments can be used. The class base URL is http://api.example.com/test for this example:

Parameter value requets URL
none http://api.example.com/test
methodPath myPath http://api.example.com/test/myPath
relativeUrl ../prod http://api.example.com/prod
See also
RestClass::call(QByteArray, const QString &, const QVariantHash &, const HeaderHash &)

◆ callRaw() [3/9]

RestReply* QtRestClient::RestClass::callRaw ( const QByteArray verb,
const QString methodPath,
const QCborValue body,
const QVariantHash &  parameters = {},
const HeaderHash headers = {} 
) const

Performs a API call of the given verb with CBOR or JSON data.

Note
Not all parameters may apply to all overloads - choose the matching ones
Parameters
verbThe HTTP-Verb to be used for the request
methodPath(optional) The path to added to the classes base URL
relativeUrl(optional) A URL to be resolved relative to the classes base URL, use as URl for the request
body(optional) The CBOR/JSON body to be sent together with the request
parametersA collection of query parameters to be added to the request URL
headersAdditional HTTP-headers to be added to the request
paramsAsBody(optional) Pass the parameters as POST-parameter method body instead of as a query url parametery
Returns
A reply object, to handle the reply to this request

This basic version allows to perform low-level CBOR/JSON calls and replies. The following table shows, how the different path arguments can be used. The class base URL is http://api.example.com/test for this example:

Parameter value requets URL
none http://api.example.com/test
methodPath myPath http://api.example.com/test/myPath
relativeUrl ../prod http://api.example.com/prod
See also
RestClass::call(QByteArray, const QString &, const QVariantHash &, const HeaderHash &)

◆ callRaw() [4/9]

RestReply* QtRestClient::RestClass::callRaw ( const QByteArray verb,
const QString methodPath,
const QJsonValue body,
const QVariantHash &  parameters = {},
const HeaderHash headers = {} 
) const

Performs a API call of the given verb with CBOR or JSON data.

Note
Not all parameters may apply to all overloads - choose the matching ones
Parameters
verbThe HTTP-Verb to be used for the request
methodPath(optional) The path to added to the classes base URL
relativeUrl(optional) A URL to be resolved relative to the classes base URL, use as URl for the request
body(optional) The CBOR/JSON body to be sent together with the request
parametersA collection of query parameters to be added to the request URL
headersAdditional HTTP-headers to be added to the request
paramsAsBody(optional) Pass the parameters as POST-parameter method body instead of as a query url parametery
Returns
A reply object, to handle the reply to this request

This basic version allows to perform low-level CBOR/JSON calls and replies. The following table shows, how the different path arguments can be used. The class base URL is http://api.example.com/test for this example:

Parameter value requets URL
none http://api.example.com/test
methodPath myPath http://api.example.com/test/myPath
relativeUrl ../prod http://api.example.com/prod
See also
RestClass::call(QByteArray, const QString &, const QVariantHash &, const HeaderHash &)

◆ callRaw() [5/9]

QtRestClient::RestClass::callRaw ( const QByteArray verb,
const QString methodPath,
const QVariantHash &  parameters = {},
const HeaderHash headers = {},
bool  paramsAsBody = false 
) const

Performs a API call of the given verb with CBOR or JSON data.

Note
Not all parameters may apply to all overloads - choose the matching ones
Parameters
verbThe HTTP-Verb to be used for the request
methodPath(optional) The path to added to the classes base URL
relativeUrl(optional) A URL to be resolved relative to the classes base URL, use as URl for the request
body(optional) The CBOR/JSON body to be sent together with the request
parametersA collection of query parameters to be added to the request URL
headersAdditional HTTP-headers to be added to the request
paramsAsBody(optional) Pass the parameters as POST-parameter method body instead of as a query url parametery
Returns
A reply object, to handle the reply to this request

This basic version allows to perform low-level CBOR/JSON calls and replies. The following table shows, how the different path arguments can be used. The class base URL is http://api.example.com/test for this example:

Parameter value requets URL
none http://api.example.com/test
methodPath myPath http://api.example.com/test/myPath
relativeUrl ../prod http://api.example.com/prod
See also
RestClass::call(QByteArray, const QString &, const QVariantHash &, const HeaderHash &)

◆ callRaw() [6/9]

RestReply* QtRestClient::RestClass::callRaw ( const QByteArray verb,
const QUrl relativeUrl,
const QCborValue body,
const QVariantHash &  parameters = {},
const HeaderHash headers = {} 
) const

Performs a API call of the given verb with CBOR or JSON data.

Note
Not all parameters may apply to all overloads - choose the matching ones
Parameters
verbThe HTTP-Verb to be used for the request
methodPath(optional) The path to added to the classes base URL
relativeUrl(optional) A URL to be resolved relative to the classes base URL, use as URl for the request
body(optional) The CBOR/JSON body to be sent together with the request
parametersA collection of query parameters to be added to the request URL
headersAdditional HTTP-headers to be added to the request
paramsAsBody(optional) Pass the parameters as POST-parameter method body instead of as a query url parametery
Returns
A reply object, to handle the reply to this request

This basic version allows to perform low-level CBOR/JSON calls and replies. The following table shows, how the different path arguments can be used. The class base URL is http://api.example.com/test for this example:

Parameter value requets URL
none http://api.example.com/test
methodPath myPath http://api.example.com/test/myPath
relativeUrl ../prod http://api.example.com/prod
See also
RestClass::call(QByteArray, const QString &, const QVariantHash &, const HeaderHash &)

◆ callRaw() [7/9]

RestReply* QtRestClient::RestClass::callRaw ( const QByteArray verb,
const QUrl relativeUrl,
const QJsonValue body,
const QVariantHash &  parameters = {},
const HeaderHash headers = {} 
) const

Performs a API call of the given verb with CBOR or JSON data.

Note
Not all parameters may apply to all overloads - choose the matching ones
Parameters
verbThe HTTP-Verb to be used for the request
methodPath(optional) The path to added to the classes base URL
relativeUrl(optional) A URL to be resolved relative to the classes base URL, use as URl for the request
body(optional) The CBOR/JSON body to be sent together with the request
parametersA collection of query parameters to be added to the request URL
headersAdditional HTTP-headers to be added to the request
paramsAsBody(optional) Pass the parameters as POST-parameter method body instead of as a query url parametery
Returns
A reply object, to handle the reply to this request

This basic version allows to perform low-level CBOR/JSON calls and replies. The following table shows, how the different path arguments can be used. The class base URL is http://api.example.com/test for this example:

Parameter value requets URL
none http://api.example.com/test
methodPath myPath http://api.example.com/test/myPath
relativeUrl ../prod http://api.example.com/prod
See also
RestClass::call(QByteArray, const QString &, const QVariantHash &, const HeaderHash &)

◆ callRaw() [8/9]

RestReply* QtRestClient::RestClass::callRaw ( const QByteArray verb,
const QUrl relativeUrl,
const QVariantHash &  parameters = {},
const HeaderHash headers = {},
bool  paramsAsBody = false 
) const

Performs a API call of the given verb with CBOR or JSON data.

Note
Not all parameters may apply to all overloads - choose the matching ones
Parameters
verbThe HTTP-Verb to be used for the request
methodPath(optional) The path to added to the classes base URL
relativeUrl(optional) A URL to be resolved relative to the classes base URL, use as URl for the request
body(optional) The CBOR/JSON body to be sent together with the request
parametersA collection of query parameters to be added to the request URL
headersAdditional HTTP-headers to be added to the request
paramsAsBody(optional) Pass the parameters as POST-parameter method body instead of as a query url parametery
Returns
A reply object, to handle the reply to this request

This basic version allows to perform low-level CBOR/JSON calls and replies. The following table shows, how the different path arguments can be used. The class base URL is http://api.example.com/test for this example:

Parameter value requets URL
none http://api.example.com/test
methodPath myPath http://api.example.com/test/myPath
relativeUrl ../prod http://api.example.com/prod
See also
RestClass::call(QByteArray, const QString &, const QVariantHash &, const HeaderHash &)

◆ callRaw() [9/9]

RestReply* QtRestClient::RestClass::callRaw ( const QByteArray verb,
const QVariantHash &  parameters = {},
const HeaderHash headers = {},
bool  paramsAsBody = false 
) const

Performs a API call of the given verb with CBOR or JSON data.

Note
Not all parameters may apply to all overloads - choose the matching ones
Parameters
verbThe HTTP-Verb to be used for the request
methodPath(optional) The path to added to the classes base URL
relativeUrl(optional) A URL to be resolved relative to the classes base URL, use as URl for the request
body(optional) The CBOR/JSON body to be sent together with the request
parametersA collection of query parameters to be added to the request URL
headersAdditional HTTP-headers to be added to the request
paramsAsBody(optional) Pass the parameters as POST-parameter method body instead of as a query url parametery
Returns
A reply object, to handle the reply to this request

This basic version allows to perform low-level CBOR/JSON calls and replies. The following table shows, how the different path arguments can be used. The class base URL is http://api.example.com/test for this example:

Parameter value requets URL
none http://api.example.com/test
methodPath myPath http://api.example.com/test/myPath
relativeUrl ../prod http://api.example.com/prod
See also
RestClass::call(QByteArray, const QString &, const QVariantHash &, const HeaderHash &)

◆ concatParams() [1/2]

QtRestClient::RestClass::concatParams ( )
inlinestatic

A generic method to concatenate parameters into a QVariantHash.

Template Parameters
argsVariadic template arguments to allow any number of parameters
Parameters
keyThe parameter name
valueThe parameters value
parametersadditional parameters in the same style (optional)
Returns
All parameters concatenated into a hash

Instead of using this function, you can use the CONCAT_PARAMS macro. It's a simple shortcut for this method. You can use it as follows:

//using the macro
auto myParams = CONCAT_PARAMS("p1", 42, "p2", "myStuff")
//equivalent to
QVariantHash myParams2 = {
{"p1", 42},
{"p2", "myStuff"}
}

Definition at line 195 of file restclass.h.

◆ concatParams() [2/2]

template<typename... Args>
QVariantHash QtRestClient::RestClass::concatParams ( const QString key,
const QVariant value,
Args...  parameters 
)
static

A generic method to concatenate parameters into a QVariantHash.

Template Parameters
argsVariadic template arguments to allow any number of parameters
Parameters
keyThe parameter name
valueThe parameters value
parametersadditional parameters in the same style (optional)
Returns
All parameters concatenated into a hash

Instead of using this function, you can use the CONCAT_PARAMS macro. It's a simple shortcut for this method. You can use it as follows:

//using the macro
auto myParams = CONCAT_PARAMS("p1", 42, "p2", "myStuff")
//equivalent to
QVariantHash myParams2 = {
{"p1", 42},
{"p2", "myStuff"}
}

Definition at line 288 of file restclass.h.

◆ deleteResource() [1/3]

template<typename DT = QObject*, typename ET = QObject*>
QtRestClient::RestClass::deleteResource ( const QString methodPath,
const QVariantHash &  parameters = {},
const HeaderHash headers = {} 
) const
inline

Performs DELETE-request with generic objects.

Note
Not all parameters may apply to all overloads - choose the matching ones
Template Parameters
DTThe expected type of the reply to this request. Defaults to QObject*
ETA type to be used for replies with an error. Defaults to QObject*
Parameters
methodPath(optional) The path to added to the classes base URL
relativeUrl(optional) A URL to be resolved relative to the classes base URL, use as URl for the request
parametersA collection of query parameters to be added to the request URL
headersAdditional HTTP-headers to be added to the request
Returns
A generic reply object for DT and ET, to handle the reply to this request

A wrapper that calls call(RestClass::DeleteVerb, ...). It's a shortcut for DELETE-requests. Check the documentation fo call for more details.

See also
RestClass::call(QByteArray, const QString &, const QVariantHash &, const HeaderHash &)

Definition at line 144 of file restclass.h.

◆ deleteResource() [2/3]

template<typename DT = QObject*, typename ET = QObject*>
GenericRestReply<DT, ET>* QtRestClient::RestClass::deleteResource ( const QUrl relativeUrl,
const QVariantHash &  parameters = {},
const HeaderHash headers = {} 
) const
inline

Performs DELETE-request with generic objects.

Note
Not all parameters may apply to all overloads - choose the matching ones
Template Parameters
DTThe expected type of the reply to this request. Defaults to QObject*
ETA type to be used for replies with an error. Defaults to QObject*
Parameters
methodPath(optional) The path to added to the classes base URL
relativeUrl(optional) A URL to be resolved relative to the classes base URL, use as URl for the request
parametersA collection of query parameters to be added to the request URL
headersAdditional HTTP-headers to be added to the request
Returns
A generic reply object for DT and ET, to handle the reply to this request

A wrapper that calls call(RestClass::DeleteVerb, ...). It's a shortcut for DELETE-requests. Check the documentation fo call for more details.

See also
RestClass::call(QByteArray, const QString &, const QVariantHash &, const HeaderHash &)

Definition at line 152 of file restclass.h.

◆ deleteResource() [3/3]

template<typename DT = QObject*, typename ET = QObject*>
GenericRestReply<DT, ET>* QtRestClient::RestClass::deleteResource ( const QVariantHash &  parameters = {},
const HeaderHash headers = {} 
) const
inline

Performs DELETE-request with generic objects.

Note
Not all parameters may apply to all overloads - choose the matching ones
Template Parameters
DTThe expected type of the reply to this request. Defaults to QObject*
ETA type to be used for replies with an error. Defaults to QObject*
Parameters
methodPath(optional) The path to added to the classes base URL
relativeUrl(optional) A URL to be resolved relative to the classes base URL, use as URl for the request
parametersA collection of query parameters to be added to the request URL
headersAdditional HTTP-headers to be added to the request
Returns
A generic reply object for DT and ET, to handle the reply to this request

A wrapper that calls call(RestClass::DeleteVerb, ...). It's a shortcut for DELETE-requests. Check the documentation fo call for more details.

See also
RestClass::call(QByteArray, const QString &, const QVariantHash &, const HeaderHash &)

Definition at line 148 of file restclass.h.

◆ get() [1/3]

template<typename DT = QObject*, typename ET = QObject*>
QtRestClient::RestClass::get ( const QString methodPath,
const QVariantHash &  parameters = {},
const HeaderHash headers = {} 
) const
inline

Performs GET-request with generic objects.

Note
Not all parameters may apply to all overloads - choose the matching ones
Template Parameters
DTThe expected type of the reply to this request. Defaults to QObject*
ETA type to be used for replies with an error. Defaults to QObject*
Parameters
methodPath(optional) The path to added to the classes base URL
relativeUrl(optional) A URL to be resolved relative to the classes base URL, use as URl for the request
parametersA collection of query parameters to be added to the request URL
headersAdditional HTTP-headers to be added to the request
Returns
A generic reply object for DT and ET, to handle the reply to this request

A wrapper that calls call(RestClass::GetVerb, ...). It's a shortcut for GET-requests. Check the documentation fo call for more details.

See also
RestClass::call(QByteArray, const QString &, const QVariantHash &, const HeaderHash &)

Definition at line 82 of file restclass.h.

◆ get() [2/3]

template<typename DT = QObject*, typename ET = QObject*>
GenericRestReply<DT, ET>* QtRestClient::RestClass::get ( const QUrl relativeUrl,
const QVariantHash &  parameters = {},
const HeaderHash headers = {} 
) const
inline

Performs GET-request with generic objects.

Note
Not all parameters may apply to all overloads - choose the matching ones
Template Parameters
DTThe expected type of the reply to this request. Defaults to QObject*
ETA type to be used for replies with an error. Defaults to QObject*
Parameters
methodPath(optional) The path to added to the classes base URL
relativeUrl(optional) A URL to be resolved relative to the classes base URL, use as URl for the request
parametersA collection of query parameters to be added to the request URL
headersAdditional HTTP-headers to be added to the request
Returns
A generic reply object for DT and ET, to handle the reply to this request

A wrapper that calls call(RestClass::GetVerb, ...). It's a shortcut for GET-requests. Check the documentation fo call for more details.

See also
RestClass::call(QByteArray, const QString &, const QVariantHash &, const HeaderHash &)

Definition at line 90 of file restclass.h.

◆ get() [3/3]

template<typename DT = QObject*, typename ET = QObject*>
GenericRestReply<DT, ET>* QtRestClient::RestClass::get ( const QVariantHash &  parameters = {},
const HeaderHash headers = {} 
) const
inline

Performs GET-request with generic objects.

Note
Not all parameters may apply to all overloads - choose the matching ones
Template Parameters
DTThe expected type of the reply to this request. Defaults to QObject*
ETA type to be used for replies with an error. Defaults to QObject*
Parameters
methodPath(optional) The path to added to the classes base URL
relativeUrl(optional) A URL to be resolved relative to the classes base URL, use as URl for the request
parametersA collection of query parameters to be added to the request URL
headersAdditional HTTP-headers to be added to the request
Returns
A generic reply object for DT and ET, to handle the reply to this request

A wrapper that calls call(RestClass::GetVerb, ...). It's a shortcut for GET-requests. Check the documentation fo call for more details.

See also
RestClass::call(QByteArray, const QString &, const QVariantHash &, const HeaderHash &)

Definition at line 86 of file restclass.h.

◆ head() [1/3]

template<typename DT = QObject*, typename ET = QObject*>
QtRestClient::RestClass::head ( const QString methodPath,
const QVariantHash &  parameters = {},
const HeaderHash headers = {} 
) const
inline

Performs HEAD-request with generic objects.

Note
Not all parameters may apply to all overloads - choose the matching ones
Template Parameters
DTThe expected type of the reply to this request. Defaults to QObject*
ETA type to be used for replies with an error. Defaults to QObject*
Parameters
methodPath(optional) The path to added to the classes base URL
relativeUrl(optional) A URL to be resolved relative to the classes base URL, use as URl for the request
parametersA collection of query parameters to be added to the request URL
headersAdditional HTTP-headers to be added to the request
Returns
A generic reply object for DT and ET, to handle the reply to this request

A wrapper that calls call(RestClass::HeadVerb, ...). It's a shortcut for HEAD-requests. Check the documentation fo call for more details.

See also
RestClass::call(QByteArray, const QString &, const QVariantHash &, const HeaderHash &)

Definition at line 176 of file restclass.h.

◆ head() [2/3]

template<typename DT = QObject*, typename ET = QObject*>
GenericRestReply<DT, ET>* QtRestClient::RestClass::head ( const QUrl relativeUrl,
const QVariantHash &  parameters = {},
const HeaderHash headers = {} 
) const
inline

Performs HEAD-request with generic objects.

Note
Not all parameters may apply to all overloads - choose the matching ones
Template Parameters
DTThe expected type of the reply to this request. Defaults to QObject*
ETA type to be used for replies with an error. Defaults to QObject*
Parameters
methodPath(optional) The path to added to the classes base URL
relativeUrl(optional) A URL to be resolved relative to the classes base URL, use as URl for the request
parametersA collection of query parameters to be added to the request URL
headersAdditional HTTP-headers to be added to the request
Returns
A generic reply object for DT and ET, to handle the reply to this request

A wrapper that calls call(RestClass::HeadVerb, ...). It's a shortcut for HEAD-requests. Check the documentation fo call for more details.

See also
RestClass::call(QByteArray, const QString &, const QVariantHash &, const HeaderHash &)

Definition at line 184 of file restclass.h.

◆ head() [3/3]

template<typename DT = QObject*, typename ET = QObject*>
GenericRestReply<DT, ET>* QtRestClient::RestClass::head ( const QVariantHash &  parameters = {},
const HeaderHash headers = {} 
) const
inline

Performs HEAD-request with generic objects.

Note
Not all parameters may apply to all overloads - choose the matching ones
Template Parameters
DTThe expected type of the reply to this request. Defaults to QObject*
ETA type to be used for replies with an error. Defaults to QObject*
Parameters
methodPath(optional) The path to added to the classes base URL
relativeUrl(optional) A URL to be resolved relative to the classes base URL, use as URl for the request
parametersA collection of query parameters to be added to the request URL
headersAdditional HTTP-headers to be added to the request
Returns
A generic reply object for DT and ET, to handle the reply to this request

A wrapper that calls call(RestClass::HeadVerb, ...). It's a shortcut for HEAD-requests. Check the documentation fo call for more details.

See also
RestClass::call(QByteArray, const QString &, const QVariantHash &, const HeaderHash &)

Definition at line 180 of file restclass.h.

◆ patch() [1/3]

template<typename DT = QObject*, typename ET = QObject*, typename RO = QObject*>
QtRestClient::RestClass::patch ( const QString methodPath,
const RO &  body,
const QVariantHash &  parameters = {},
const HeaderHash headers = {} 
) const
inline

Performs PATCH-request with generic objects.

Note
Not all parameters may apply to all overloads - choose the matching ones
Template Parameters
DTThe expected type of the reply to this request. Defaults to QObject*
ETA type to be used for replies with an error. Defaults to QObject*
ROThe type of the data specified with the body parameter
Parameters
methodPath(optional) The path to added to the classes base URL
relativeUrl(optional) A URL to be resolved relative to the classes base URL, use as URl for the request
bodyThe body object to be sent together with the request
parametersA collection of query parameters to be added to the request URL
headersAdditional HTTP-headers to be added to the request
Returns
A generic reply object for DT and ET, to handle the reply to this request
Exceptions
QJsonSerializationExceptionWill be thrown, if the body cannot be serializer to JSON

A wrapper that calls call(RestClass::PatchVerb, ...). It's a shortcut for PATCH-requests. Check the documentation fo call for more details.

See also
RestClass::call(QByteArray, const QString &, const QVariantHash &, const HeaderHash &)

Definition at line 160 of file restclass.h.

◆ patch() [2/3]

template<typename DT = QObject*, typename ET = QObject*, typename RO = QObject*>
GenericRestReply<DT, ET>* QtRestClient::RestClass::patch ( const QUrl relativeUrl,
const RO &  body,
const QVariantHash &  parameters = {},
const HeaderHash headers = {} 
) const
inline

Performs PATCH-request with generic objects.

Note
Not all parameters may apply to all overloads - choose the matching ones
Template Parameters
DTThe expected type of the reply to this request. Defaults to QObject*
ETA type to be used for replies with an error. Defaults to QObject*
ROThe type of the data specified with the body parameter
Parameters
methodPath(optional) The path to added to the classes base URL
relativeUrl(optional) A URL to be resolved relative to the classes base URL, use as URl for the request
bodyThe body object to be sent together with the request
parametersA collection of query parameters to be added to the request URL
headersAdditional HTTP-headers to be added to the request
Returns
A generic reply object for DT and ET, to handle the reply to this request
Exceptions
QJsonSerializationExceptionWill be thrown, if the body cannot be serializer to JSON

A wrapper that calls call(RestClass::PatchVerb, ...). It's a shortcut for PATCH-requests. Check the documentation fo call for more details.

See also
RestClass::call(QByteArray, const QString &, const QVariantHash &, const HeaderHash &)

Definition at line 168 of file restclass.h.

◆ patch() [3/3]

template<typename DT = QObject*, typename ET = QObject*, typename RO = QObject*>
GenericRestReply<DT, ET>* QtRestClient::RestClass::patch ( const RO &  body,
const QVariantHash &  parameters = {},
const HeaderHash headers = {} 
) const
inline

Performs PATCH-request with generic objects.

Note
Not all parameters may apply to all overloads - choose the matching ones
Template Parameters
DTThe expected type of the reply to this request. Defaults to QObject*
ETA type to be used for replies with an error. Defaults to QObject*
ROThe type of the data specified with the body parameter
Parameters
methodPath(optional) The path to added to the classes base URL
relativeUrl(optional) A URL to be resolved relative to the classes base URL, use as URl for the request
bodyThe body object to be sent together with the request
parametersA collection of query parameters to be added to the request URL
headersAdditional HTTP-headers to be added to the request
Returns
A generic reply object for DT and ET, to handle the reply to this request
Exceptions
QJsonSerializationExceptionWill be thrown, if the body cannot be serializer to JSON

A wrapper that calls call(RestClass::PatchVerb, ...). It's a shortcut for PATCH-requests. Check the documentation fo call for more details.

See also
RestClass::call(QByteArray, const QString &, const QVariantHash &, const HeaderHash &)

Definition at line 164 of file restclass.h.

◆ post() [1/6]

template<typename DT = QObject*, typename ET = QObject*>
QtRestClient::RestClass::post ( const QString methodPath,
const QVariantHash &  parameters = {},
const HeaderHash headers = {} 
) const
inline

Performs POST-request with generic objects.

Note
Not all parameters may apply to all overloads - choose the matching ones
Template Parameters
DTThe expected type of the reply to this request. Defaults to QObject*
ETA type to be used for replies with an error. Defaults to QObject*
ROThe type of the data specified with the body parameter
Parameters
methodPath(optional) The path to added to the classes base URL
relativeUrl(optional) A URL to be resolved relative to the classes base URL, use as URl for the request
body(optional) The body object to be sent together with the request
parametersA collection of query parameters to be added to the request URL
headersAdditional HTTP-headers to be added to the request
Returns
A generic reply object for DT and ET, to handle the reply to this request
Exceptions
QJsonSerializationExceptionWill be thrown, if the body cannot be serializer to JSON

A wrapper that calls call(RestClass::PostVerb, ...). It's a shortcut for POST-requests. Check the documentation fo call for more details.

See also
RestClass::call(QByteArray, const QString &, const QVariantHash &, const HeaderHash &)

Definition at line 98 of file restclass.h.

◆ post() [2/6]

template<typename DT = QObject*, typename ET = QObject*, typename RO = QObject*>
GenericRestReply<DT, ET>* QtRestClient::RestClass::post ( const QString methodPath,
const RO &  body,
const HeaderHash headers = {} 
) const
inline

Performs POST-request with generic objects.

Note
Not all parameters may apply to all overloads - choose the matching ones
Template Parameters
DTThe expected type of the reply to this request. Defaults to QObject*
ETA type to be used for replies with an error. Defaults to QObject*
ROThe type of the data specified with the body parameter
Parameters
methodPath(optional) The path to added to the classes base URL
relativeUrl(optional) A URL to be resolved relative to the classes base URL, use as URl for the request
body(optional) The body object to be sent together with the request
parametersA collection of query parameters to be added to the request URL
headersAdditional HTTP-headers to be added to the request
Returns
A generic reply object for DT and ET, to handle the reply to this request
Exceptions
QJsonSerializationExceptionWill be thrown, if the body cannot be serializer to JSON

A wrapper that calls call(RestClass::PostVerb, ...). It's a shortcut for POST-requests. Check the documentation fo call for more details.

See also
RestClass::call(QByteArray, const QString &, const QVariantHash &, const HeaderHash &)

Definition at line 102 of file restclass.h.

◆ post() [3/6]

template<typename DT = QObject*, typename ET = QObject*>
GenericRestReply<DT, ET>* QtRestClient::RestClass::post ( const QUrl relativeUrl,
const QVariantHash &  parameters = {},
const HeaderHash headers = {} 
) const
inline

Performs POST-request with generic objects.

Note
Not all parameters may apply to all overloads - choose the matching ones
Template Parameters
DTThe expected type of the reply to this request. Defaults to QObject*
ETA type to be used for replies with an error. Defaults to QObject*
ROThe type of the data specified with the body parameter
Parameters
methodPath(optional) The path to added to the classes base URL
relativeUrl(optional) A URL to be resolved relative to the classes base URL, use as URl for the request
body(optional) The body object to be sent together with the request
parametersA collection of query parameters to be added to the request URL
headersAdditional HTTP-headers to be added to the request
Returns
A generic reply object for DT and ET, to handle the reply to this request
Exceptions
QJsonSerializationExceptionWill be thrown, if the body cannot be serializer to JSON

A wrapper that calls call(RestClass::PostVerb, ...). It's a shortcut for POST-requests. Check the documentation fo call for more details.

See also
RestClass::call(QByteArray, const QString &, const QVariantHash &, const HeaderHash &)

Definition at line 116 of file restclass.h.

◆ post() [4/6]

template<typename DT = QObject*, typename ET = QObject*, typename RO = QObject*>
GenericRestReply<DT, ET>* QtRestClient::RestClass::post ( const QUrl relativeUrl,
const RO &  body,
const HeaderHash headers = {} 
) const
inline

Performs POST-request with generic objects.

Note
Not all parameters may apply to all overloads - choose the matching ones
Template Parameters
DTThe expected type of the reply to this request. Defaults to QObject*
ETA type to be used for replies with an error. Defaults to QObject*
ROThe type of the data specified with the body parameter
Parameters
methodPath(optional) The path to added to the classes base URL
relativeUrl(optional) A URL to be resolved relative to the classes base URL, use as URl for the request
body(optional) The body object to be sent together with the request
parametersA collection of query parameters to be added to the request URL
headersAdditional HTTP-headers to be added to the request
Returns
A generic reply object for DT and ET, to handle the reply to this request
Exceptions
QJsonSerializationExceptionWill be thrown, if the body cannot be serializer to JSON

A wrapper that calls call(RestClass::PostVerb, ...). It's a shortcut for POST-requests. Check the documentation fo call for more details.

See also
RestClass::call(QByteArray, const QString &, const QVariantHash &, const HeaderHash &)

Definition at line 120 of file restclass.h.

◆ post() [5/6]

template<typename DT = QObject*, typename ET = QObject*>
GenericRestReply<DT, ET>* QtRestClient::RestClass::post ( const QVariantHash &  parameters = {},
const HeaderHash headers = {} 
) const
inline

Performs POST-request with generic objects.

Note
Not all parameters may apply to all overloads - choose the matching ones
Template Parameters
DTThe expected type of the reply to this request. Defaults to QObject*
ETA type to be used for replies with an error. Defaults to QObject*
ROThe type of the data specified with the body parameter
Parameters
methodPath(optional) The path to added to the classes base URL
relativeUrl(optional) A URL to be resolved relative to the classes base URL, use as URl for the request
body(optional) The body object to be sent together with the request
parametersA collection of query parameters to be added to the request URL
headersAdditional HTTP-headers to be added to the request
Returns
A generic reply object for DT and ET, to handle the reply to this request
Exceptions
QJsonSerializationExceptionWill be thrown, if the body cannot be serializer to JSON

A wrapper that calls call(RestClass::PostVerb, ...). It's a shortcut for POST-requests. Check the documentation fo call for more details.

See also
RestClass::call(QByteArray, const QString &, const QVariantHash &, const HeaderHash &)

Definition at line 107 of file restclass.h.

◆ post() [6/6]

template<typename DT = QObject*, typename ET = QObject*, typename RO = QObject*>
GenericRestReply<DT, ET>* QtRestClient::RestClass::post ( const RO &  body,
const HeaderHash headers = {} 
) const
inline

Performs POST-request with generic objects.

Note
Not all parameters may apply to all overloads - choose the matching ones
Template Parameters
DTThe expected type of the reply to this request. Defaults to QObject*
ETA type to be used for replies with an error. Defaults to QObject*
ROThe type of the data specified with the body parameter
Parameters
methodPath(optional) The path to added to the classes base URL
relativeUrl(optional) A URL to be resolved relative to the classes base URL, use as URl for the request
body(optional) The body object to be sent together with the request
parametersA collection of query parameters to be added to the request URL
headersAdditional HTTP-headers to be added to the request
Returns
A generic reply object for DT and ET, to handle the reply to this request
Exceptions
QJsonSerializationExceptionWill be thrown, if the body cannot be serializer to JSON

A wrapper that calls call(RestClass::PostVerb, ...). It's a shortcut for POST-requests. Check the documentation fo call for more details.

See also
RestClass::call(QByteArray, const QString &, const QVariantHash &, const HeaderHash &)

Definition at line 111 of file restclass.h.

◆ put() [1/3]

template<typename DT = QObject*, typename ET = QObject*, typename RO = QObject*>
QtRestClient::RestClass::put ( const QString methodPath,
const RO &  body,
const QVariantHash &  parameters = {},
const HeaderHash headers = {} 
) const
inline

Performs PUT-request with generic objects.

Note
Not all parameters may apply to all overloads - choose the matching ones
Template Parameters
DTThe expected type of the reply to this request. Defaults to QObject*
ETA type to be used for replies with an error. Defaults to QObject*
ROThe type of the data specified with the body parameter
Parameters
methodPath(optional) The path to added to the classes base URL
relativeUrl(optional) A URL to be resolved relative to the classes base URL, use as URl for the request
bodyThe body object to be sent together with the request
parametersA collection of query parameters to be added to the request URL
headersAdditional HTTP-headers to be added to the request
Returns
A generic reply object for DT and ET, to handle the reply to this request
Exceptions
QJsonSerializationExceptionWill be thrown, if the body cannot be serializer to JSON

A wrapper that calls call(RestClass::PutVerb, ...). It's a shortcut for PUT-requests. Check the documentation fo call for more details.

See also
RestClass::call(QByteArray, const QString &, const QVariantHash &, const HeaderHash &)

Definition at line 128 of file restclass.h.

◆ put() [2/3]

template<typename DT = QObject*, typename ET = QObject*, typename RO = QObject*>
GenericRestReply<DT, ET>* QtRestClient::RestClass::put ( const QUrl relativeUrl,
const RO &  body,
const QVariantHash &  parameters = {},
const HeaderHash headers = {} 
) const
inline

Performs PUT-request with generic objects.

Note
Not all parameters may apply to all overloads - choose the matching ones
Template Parameters
DTThe expected type of the reply to this request. Defaults to QObject*
ETA type to be used for replies with an error. Defaults to QObject*
ROThe type of the data specified with the body parameter
Parameters
methodPath(optional) The path to added to the classes base URL
relativeUrl(optional) A URL to be resolved relative to the classes base URL, use as URl for the request
bodyThe body object to be sent together with the request
parametersA collection of query parameters to be added to the request URL
headersAdditional HTTP-headers to be added to the request
Returns
A generic reply object for DT and ET, to handle the reply to this request
Exceptions
QJsonSerializationExceptionWill be thrown, if the body cannot be serializer to JSON

A wrapper that calls call(RestClass::PutVerb, ...). It's a shortcut for PUT-requests. Check the documentation fo call for more details.

See also
RestClass::call(QByteArray, const QString &, const QVariantHash &, const HeaderHash &)

Definition at line 136 of file restclass.h.

◆ put() [3/3]

template<typename DT = QObject*, typename ET = QObject*, typename RO = QObject*>
GenericRestReply<DT, ET>* QtRestClient::RestClass::put ( const RO &  body,
const QVariantHash &  parameters = {},
const HeaderHash headers = {} 
) const
inline

Performs PUT-request with generic objects.

Note
Not all parameters may apply to all overloads - choose the matching ones
Template Parameters
DTThe expected type of the reply to this request. Defaults to QObject*
ETA type to be used for replies with an error. Defaults to QObject*
ROThe type of the data specified with the body parameter
Parameters
methodPath(optional) The path to added to the classes base URL
relativeUrl(optional) A URL to be resolved relative to the classes base URL, use as URl for the request
bodyThe body object to be sent together with the request
parametersA collection of query parameters to be added to the request URL
headersAdditional HTTP-headers to be added to the request
Returns
A generic reply object for DT and ET, to handle the reply to this request
Exceptions
QJsonSerializationExceptionWill be thrown, if the body cannot be serializer to JSON

A wrapper that calls call(RestClass::PutVerb, ...). It's a shortcut for PUT-requests. Check the documentation fo call for more details.

See also
RestClass::call(QByteArray, const QString &, const QVariantHash &, const HeaderHash &)

Definition at line 132 of file restclass.h.


The documentation for this class was generated from the following files:
CONCAT_PARAMS
#define CONCAT_PARAMS
Short macro for RestClass::concatParams(), to make the call shorter.
Definition: restclass.h:227
QtRestClient::RestClass::builder
virtual RequestBuilder builder() const
Creates a request builder for this class.