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::RequestBuilder::IExtender Class Reference

A simple interface to add custom extensions to the building process. More...

#include <requestbuilder.h>

+ Inheritance diagram for QtRestClient::RequestBuilder::IExtender:

Public Member Functions

virtual void extendUrl (QUrl &url) const
 Perform additional operations on the URL.
 
virtual bool requiresBody () const
 Specifies, whether extendRequest() always requires the body parameter.
 
virtual void extendRequest (QNetworkRequest &request, QByteArray &verb, QByteArray *body) const
 Perform additional operations on the request.
 

Detailed Description

A simple interface to add custom extensions to the building process.

The extender can be used to change the generated URL/request as last step of the building process. This allows you to modify the generated URLs and requests without having to create a custom builder.

You can implement the extendUrl() method to apply changes to any generated URL. The extendRequest() method is used after a QNetworkRequest has been generated (the URL of the request will already be extended via extendUrl()). Some extenders require the body of a request to perform their modifications, even if a request is only created, not sent yet. In that case, implement requiresBody() and return true` there.

Definition at line 28 of file requestbuilder.h.


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