|
RestLink 2.2.0
Powerfull Rest Client for Qt
|
A custom network manager for handling HTTP requests and responses in RestLink. More...
#include <networkmanager.h>
Inherits QNetworkAccessManager, and RestLink::AbstractRequestHandler.
Public Member Functions | |
| NetworkManager (QObject *parent=nullptr) | |
| Constructs a NetworkManager with a specified parent. | |
| QStringList | supportedSchemes () const override final |
| HandlerType | handlerType () const override final |
| Response * | head (const Request &request) |
| Sends a HEAD request. | |
| Response * | get (const Request &request) |
| Sends a GET request. | |
| Response * | post (const Request &request, const Body &body) |
| Sends a POST request. | |
| Response * | put (const Request &request, const Body &body) |
| Sends a PUT request. | |
| Response * | patch (const Request &request, const Body &body) |
| Sends a PATCH request. | |
| Response * | deleteResource (const Request &request) |
| Sends a DELETE request. | |
Public Member Functions inherited from RestLink::AbstractRequestHandler | |
| virtual | ~AbstractRequestHandler () |
| Destructor for RequestHandler. | |
| virtual QString | handlerName () const |
| Returns the name of the handler based on its type. | |
| Response * | head (const Request &request) |
| Sends a HEAD request. | |
| Response * | get (const Request &request) |
| Sends a GET request. | |
| Response * | post (const Request &request, const Body &body) |
| Sends a POST request. | |
| Response * | put (const Request &request, const Body &body) |
| Sends a PUT request. | |
| Response * | patch (const Request &request, const Body &body) |
| Sends a PATCH request. | |
| Response * | deleteResource (const Request &request) |
| Sends a DELETE request. | |
| Response * | send (Method method, const Request &request, const Body &body) |
| QList< AbstractRequestInterceptor * > | requestInterceptors () const |
| Returns the list of registered request interceptors. | |
| void | addRequestInterceptor (AbstractRequestInterceptor *interceptor) |
| Adds a new request interceptor. | |
| void | removeRequestInterceptor (AbstractRequestInterceptor *interceptor) |
| Removes a request interceptor. | |
Protected Member Functions | |
| Response * | sendRequest (Method method, const Request &request, const Body &body) override |
| QNetworkRequest | generateNetworkRequest (Method method, const Request &request, const Body &body) |
| QNetworkReply * | generateNetworkReply (Method method, const QNetworkRequest &request, const Body &body) |
Protected Member Functions inherited from RestLink::AbstractRequestHandler | |
| AbstractRequestHandler () | |
| bool | isRequestSupported (const Request &request) const |
| Checks if the request is supported by this handler. | |
| void | initResponse (Response *response, const Request &request, Method method) |
| Initializes the response object with the associated request. | |
Properties | |
| QStringList | supportedSchemes |
Additional Inherited Members | |
Public Types inherited from RestLink::AbstractRequestHandler | |
| enum | Method { HeadMethod , GetMethod , PostMethod , PutMethod , PatchMethod , DeleteMethod , UnknownMethod = -1 } |
| Defines supported HTTP methods for handling outgoing requests. More... | |
| enum | HandlerType { NetworkManager , ServerHandler , UnknownHandler = -1 } |
| Describes the type of request handler being used. More... | |
Protected Attributes inherited from RestLink::AbstractRequestHandler | |
| QScopedPointer< AbstractRequestHandlerPrivate > | d_ptr |
A custom network manager for handling HTTP requests and responses in RestLink.
This class extends QNetworkAccessManager to provide additional functionality, including custom caching and cookie management, as well as redirect policy control. It is designed to be the core network handling component of RestLink.
|
explicit |
Constructs a NetworkManager with a specified parent.
Initializes the network manager with a default cache and cookie jar. Also sets the redirect policy to SameOriginRedirectPolicy to ensure secure handling of redirections within the same origin.
| parent | The parent object for this NetworkManager. Defaults to nullptr. |
|
finaloverridevirtual |
Implements RestLink::AbstractRequestHandler.
|
finaloverridevirtual |
Implements RestLink::AbstractRequestHandler.
|
overrideprotectedvirtual |
Implements RestLink::AbstractRequestHandler.
|
protected |
|
protected |
Sends a POST request.
Sends a PUT request.
Sends a PATCH request.
Sends a DELETE request.
|
read |