RestLink 2.2.0
Powerfull Rest Client for Qt
Loading...
Searching...
No Matches
Public Member Functions | List of all members
RestLink::AbstractRequestInterceptor Class Referenceabstract

Interface for intercepting and modifying HTTP requests and their bodies before dispatch. More...

#include <abstractrequestinterceptor.h>

Inherited by RestLink::LogRequestInterceptor.

Public Member Functions

virtual ~AbstractRequestInterceptor ()=default
 
virtual void intercept (AbstractRequestHandler::Method method, Request &request, Body &body)=0
 Called before a request is sent, allowing modification of both request and body.
 

Detailed Description

Interface for intercepting and modifying HTTP requests and their bodies before dispatch.

Implement this class to apply custom logic to HTTP requests before they are sent. Typical use cases include injecting authentication tokens, customizing headers, modifying the request URL, or altering the request body.

This is useful for logging, request signing, transforming payloads, or enforcing global rules. The interceptor is called just before the request is dispatched.

See also
ApiBase, Request, Body, AbstractRequestHandler::Method

Constructor & Destructor Documentation

◆ ~AbstractRequestInterceptor()

virtual RestLink::AbstractRequestInterceptor::~AbstractRequestInterceptor ( )
virtualdefault

Member Function Documentation

◆ intercept()

RestLink::AbstractRequestInterceptor::intercept ( AbstractRequestHandler::Method  method,
Request request,
Body body 
)
pure virtual

Called before a request is sent, allowing modification of both request and body.

Use this method to alter the HTTP method, headers, URL, or the body content prior to transmission.

Parameters
methodThe HTTP method (GET, POST, PUT, etc.).
requestThe request object to be modified.
bodyThe body associated with the request, which can also be modified.

Implemented in RestLink::LogRequestInterceptor.