|
RestLink 2.2.0
Powerfull Rest Client for Qt
|
The AbstractRequestHandler class defines an abstract base for sending HTTP-like requests. More...
#include <abstractrequesthandler.h>
Inherited by RestLink::NetworkManager, and RestLink::Server.
Public Types | |
| 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... | |
Public Member Functions | |
| 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. | |
| virtual QStringList | supportedSchemes () const =0 |
| virtual HandlerType | handlerType () const =0 |
Protected Member Functions | |
| 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. | |
| virtual Response * | sendRequest (Method method, const Request &request, const Body &body)=0 |
Protected Attributes | |
| QScopedPointer< AbstractRequestHandlerPrivate > | d_ptr |
The AbstractRequestHandler class defines an abstract base for sending HTTP-like requests.
It provides generic methods to send requests using standard HTTP methods (GET, POST, etc.). Subclasses must implement scheme support and request sending behavior.
Defines supported HTTP methods for handling outgoing requests.
This enum is used to identify the HTTP method associated with a request.
Describes the type of request handler being used.
This enum helps identify the underlying implementation responsible for processing the request.
| Enumerator | |
|---|---|
| NetworkManager | Indicates that the handler is based on the NetworkManager class (typically used for client-side requests). |
| ServerHandler | Indicates that the handler is based on the Server class (typically used for server-side processing). |
| UnknownHandler | Indicates an unknown or custom handler type not explicitly defined by the framework. |
|
virtual |
Destructor for RequestHandler.
|
protected |
|
virtual |
Returns the name of the handler based on its type.
Sends a POST request.
Sends a PUT request.
Sends a PATCH request.
Sends a DELETE request.
| Response * RestLink::AbstractRequestHandler::send | ( | Method | method, |
| const Request & | request, | ||
| const Body & | body | ||
| ) |
| QList< AbstractRequestInterceptor * > RestLink::AbstractRequestHandler::requestInterceptors | ( | ) | const |
Returns the list of registered request interceptors.
| void RestLink::AbstractRequestHandler::addRequestInterceptor | ( | AbstractRequestInterceptor * | interceptor | ) |
Adds a new request interceptor.
| void RestLink::AbstractRequestHandler::removeRequestInterceptor | ( | AbstractRequestInterceptor * | interceptor | ) |
Removes a request interceptor.
|
pure virtual |
Implemented in RestLink::NetworkManager.
|
pure virtual |
Implemented in RestLink::Server, and RestLink::NetworkManager.
|
protected |
Checks if the request is supported by this handler.
|
protected |
Initializes the response object with the associated request.
It's recommended to use this method to initialize your response objects.
|
protectedpure virtual |
Implemented in RestLink::NetworkManager, and RestLink::Server.
|
protected |