Webserv
Loading...
Searching...
No Matches
http::IHandler Class Referenceabstract

Abstract interface for all request handlers (Strategy Pattern). More...

#include <Handler.hpp>

Inheritance diagram for http::IHandler:
http::CGIHandler http::DefaultErrorHandler http::NotFoundHandler http::StaticFileHandler

Public Member Functions

virtual ~IHandler ()
virtual HttpResponse handle (HttpRequest const &, config::ServerBlock const *, config::LocationBlock const *) const =0
 The primary handler logic entry point.
HttpResponse handle (HttpRequest const &h, RouterResult const &r) const
 Convenience overload to handle a request using a RouterResult.

Detailed Description

Abstract interface for all request handlers (Strategy Pattern).

Defines the contract for stateless handler objects that process HTTP requests.

Constructor & Destructor Documentation

◆ ~IHandler()

virtual http::IHandler::~IHandler ( )
inlinevirtual

Member Function Documentation

◆ handle() [1/2]

virtual HttpResponse http::IHandler::handle ( HttpRequest const & ,
config::ServerBlock const * ,
config::LocationBlock const *  ) const
pure virtual

The primary handler logic entry point.

Parameters
requestThe client's HTTP request.
serverThe matched server configuration context.
locationThe matched location configuration context.
Returns
An HttpResponse object representing the result of the handling.

Implemented in http::CGIHandler, http::DefaultErrorHandler, http::NotFoundHandler, and http::StaticFileHandler.

◆ handle() [2/2]

HttpResponse http::IHandler::handle ( HttpRequest const & h,
RouterResult const & r ) const
inline

Convenience overload to handle a request using a RouterResult.


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