Template Struct content_wrapper0

Struct Documentation

template<typename F>
struct udho::content_wrapper0

mapping of an url with a http request defined by http method and the url pattern

A content wrapper is defined by a HTTP verb, a callback and a url pattern. A content wrapper uses a compositor that prepares a HTTP response based on the callbacks return

Template Parameters
  • F: callback type

Public Types

typedef content_wrapper0<F> self_type

Public Functions

content_wrapper0(boost::beast::http::verb method, F ftor)
template<template<typename> class CompositorT = compositors::transparent>
auto unwrap(CompositorT<typename internal::function_signature<F>::return_type> compositor = CompositorT<typename internal::function_signature<F>::return_type>())
auto deferred()
auto raw()

raw content delivery using transparent compositor

auto operator=(const std::string &pattern)

attach an url pattern

auto mimed(std::string mime)

applies a mimed compositor on the return

Parameters
  • mime: returned mime type

auto html()

shorthand for html mime type

auto plain()

shorthand for plain text mime type

auto json()

shorthand for json mime type

Public Members

F _ftor
boost::beast::http::verb _method