RestLink
2.2.0
Powerfull Rest Client for Qt
Loading...
Searching...
No Matches
src
lib
abstractrequestinterceptor.h
1
#ifndef RESTLINK_ABSTRACTREQUESTINTERCEPTOR_H
2
#define RESTLINK_ABSTRACTREQUESTINTERCEPTOR_H
3
4
#include <QtCore/qloggingcategory.h>
5
6
#include <RestLink/global.h>
7
#include <RestLink/abstractrequesthandler.h>
8
9
namespace
RestLink
{
10
11
class
RESTLINK_EXPORT
AbstractRequestInterceptor
12
{
13
public
:
14
virtual
~AbstractRequestInterceptor
() =
default
;
15
16
virtual
void
intercept
(
AbstractRequestHandler::Method
method,
Request
&request,
Body
&body) = 0;
17
};
18
19
class
RESTLINK_EXPORT
LogRequestInterceptor
:
public
AbstractRequestInterceptor
20
{
21
public
:
22
LogRequestInterceptor
(
const
char
*category, QtMsgType enableForLevel = QtDebugMsg);
23
LogRequestInterceptor
(QLoggingCategory *category);
24
~LogRequestInterceptor
();
25
26
void
intercept(
AbstractRequestHandler::Method
method,
Request
&request,
Body
&body)
override
;
27
28
private
:
29
QLoggingCategory *m_category;
30
bool
m_deleteCategory;
31
};
32
33
}
34
35
#endif
// RESTLINK_ABSTRACTREQUESTINTERCEPTOR_H
RestLink::AbstractRequestHandler::Method
Method
Defines supported HTTP methods for handling outgoing requests.
Definition
abstractrequesthandler.h:19
RestLink::AbstractRequestInterceptor
Interface for intercepting and modifying HTTP requests and their bodies before dispatch.
Definition
abstractrequestinterceptor.h:12
RestLink::AbstractRequestInterceptor::~AbstractRequestInterceptor
virtual ~AbstractRequestInterceptor()=default
RestLink::AbstractRequestInterceptor::intercept
virtual void intercept(AbstractRequestHandler::Method method, Request &request, Body &body)=0
Called before a request is sent, allowing modification of both request and body.
RestLink::Body
Represents the body of an HTTP request.
Definition
body.h:27
RestLink::LogRequestInterceptor
Helper class to create a simple logger for RestLink requests.
Definition
abstractrequestinterceptor.h:20
RestLink::Request
A class for storing and managing HTTP request information.
Definition
request.h:25
RestLink
Definition
abstractrequesthandler.cpp:11
Generated by
1.9.8