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

An extension of the RequestBuilder that uses a QAbstractOAuth to create authenticated requests. More...

#include <authrequestbuilder.h>

+ Inheritance diagram for QtRestClient::Auth::AuthRequestBuilder:

Public Member Functions

 AuthRequestBuilder (const QUrl &baseUrl, QAbstractOAuth *oAuth=nullptr, QNetworkAccessManager *nam=nullptr)
 Constructs a builder with the given base url and an OAuth instance to authenticate requests with.
 
 AuthRequestBuilder (const AuthRequestBuilder &other)
 Copy constructor.
 
 AuthRequestBuilder (AuthRequestBuilder &&other) noexcept
 Move constructor.
 
AuthRequestBuilderoperator= (const AuthRequestBuilder &other)
 Copy assignment operator.
 
AuthRequestBuilderoperator= (AuthRequestBuilder &&other) noexcept
 Move assignment operator.
 
AuthRequestBuildersetOAuth (QAbstractOAuth *oAuth, bool replaceNam=true)
 Sets the OAuth instance to authenticate requests created via build() or send()
 
- Public Member Functions inherited from QtRestClient::RequestBuilder
 RequestBuilder (const QUrl &baseUrl, QNetworkAccessManager *nam=nullptr)
 Constructs a builder with the given base url. More...
 
 RequestBuilder (const RequestBuilder &other)
 Copy constructor.
 
 RequestBuilder (RequestBuilder &&other) noexcept
 Move constructor.
 
RequestBuilderoperator= (const RequestBuilder &other)
 Copy assignment operator.
 
RequestBuilderoperator= (RequestBuilder &&other) noexcept
 Move assignment operator.
 
RequestBuildersetNetworkAccessManager (QNetworkAccessManager *nam)
 Sets the network access manager to be used for send() More...
 
RequestBuildersetExtender (IExtender *extender)
 Sets the extender to use for extending the build. More...
 
RequestBuildersetCredentials (QString user, QString password={})
 Sets the credentails of the URL. More...
 
RequestBuildersetVersion (QVersionNumber version)
 Sets the version of the API. More...
 
RequestBuilderaddPath (const QString &pathSegment)
 appends a path segment to the builders path More...
 
RequestBuilderaddPath (const QStringList &pathSegment)
 appends a path segment to the builders path More...
 
RequestBuildertrailingSlash (bool enable=true)
 Enables the trailing slash for the generated URL. More...
 
RequestBuilderaddParameter (const QString &name, const QString &value)
 Adds a parameter to the URL. More...
 
RequestBuilderaddParameters (const QUrlQuery &parameters)
 Adds parameters to the URL. More...
 
RequestBuildersetFragment (QString fragment)
 Sets the fragment part of the URL. More...
 
RequestBuilderaddHeader (const QByteArray &name, const QByteArray &value)
 Adds a HTTP header to be added to the network request. More...
 
RequestBuilderaddHeaders (const HeaderHash &headers)
 Adds HTTP headers to be added to the network request. More...
 
RequestBuilderupdateFromRelativeUrl (const QUrl &url, bool mergeQuery=false, bool keepFragment=false)
 Updates the builder from the (relative) URL and includes all of it's elements. More...
 
RequestBuildersetAttribute (QNetworkRequest::Attribute attribute, const QVariant &value)
 Sets the given attribute on the generated network request. More...
 
RequestBuildersetAttributes (const QHash< QNetworkRequest::Attribute, QVariant > &attributes)
 Sets the given attributes on the generated network request. More...
 
RequestBuildersetSslConfig (QSslConfiguration sslConfig)
 Sets the ssl configuration to be used by the network request. More...
 
RequestBuildersetBody (QByteArray body, const QByteArray &contentType, bool setAccept=true)
 Sets the content of the generated network request. More...
 
RequestBuildersetBody (QCborValue body, bool setAccept=true)
 Sets the content of the generated network request. More...
 
RequestBuildersetBody (const QJsonValue &body, bool setAccept=true)
 Sets the content of the generated network request. More...
 
RequestBuildersetVerb (QByteArray verb)
 Sets the HTTP-Verb to be used by the generated network request. More...
 
RequestBuildersetAccept (const QByteArray &mimeType)
 Sets the "Accept" HTTP-header to the given mimetype. More...
 
RequestBuildersetAccept (const QMimeType &mimeType)
 Sets the "Accept" HTTP-header to the given mimetype. More...
 
RequestBuilderaddPostParameter (const QString &name, const QString &value)
 Adds a post parameter to the body. More...
 
RequestBuilderaddPostParameters (const QUrlQuery &parameters)
 Adds post parameters to the body. More...
 
QUrl buildUrl () const
 Creates a URL from the builder settings. More...
 
QNetworkRequest build () const
 Creates a network request from the builder settings. More...
 
QNetworkReplysend () const
 Creates a network request and sends it with the builder settings. More...
 
QFuture< QNetworkReply * > sendAsync () const
 Asynchronously creates a network request and sends it with the builder settings. More...
 

Detailed Description

An extension of the RequestBuilder that uses a QAbstractOAuth to create authenticated requests.

Definition at line 32 of file authrequestbuilder.h.


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