# ResponseInterceptor.hpp

This File On Github
Ask A Question

API: latest
module: oatpp
#include "oatpp/web/server/interceptor/ResponseInterceptor.hpp"

# ResponseInterceptor


namespace oatpp { namespace web { namespace server { namespace interceptor { 
  class ResponseInterceptor {}

# Typedefs

Type Name Summary
oatpp::web::protocol::http::incoming::Request IncomingRequest Convenience typedef for oatpp::web::protocol::http::incoming::Request.
oatpp::web::protocol::http::outgoing::Response OutgoingResponse Convenience typedef for oatpp::web::protocol::http::outgoing::Response.

# Methods

Return Type Name Summary
[none] ~ResponseInterceptor Default virtual destructor.
std::shared_ptr<OutgoingResponse> intercept This method should not do any "heavy" nor I/O operations

# ResponseInterceptor::IncomingRequest

Convenience typedef for oatpp::web::protocol::http::incoming::Request.

typedef oatpp::web::protocol::http::incoming::Request IncomingRequest

# ResponseInterceptor::OutgoingResponse

Convenience typedef for oatpp::web::protocol::http::outgoing::Response.

typedef oatpp::web::protocol::http::outgoing::Response OutgoingResponse

# ResponseInterceptor::~ResponseInterceptor

Default virtual destructor.

virtual ~ResponseInterceptor() = default

# ResponseInterceptor::intercept

This method should not do any "heavy" nor I/O operations
as it is used for both "Simple" and "Async" API
NOT FOR I/O operations!!!

- return the same response, or the new one.
- do NOT return nullptr.

possible usage ex: add extra headers to the response.

virtual std::shared_ptr<OutgoingResponse> intercept(const std::shared_ptr<IncomingRequest>& request,
                                                    const std::shared_ptr<OutgoingResponse>& response) = 0