Template Struct content_wrapper1¶
Defined in File router.h
Struct Documentation¶
-
template<typename
F, typenameA1>
structudho::content_wrapper1¶ 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
- Note
binds a variable by reference with the mapping, which might be a database connection or some persistent stateful object
- Template Parameters
F: callback typeA1: type of the passed value which will be passed by reference
Public Types
-
typedef content_wrapper1<F, A1>
self_type¶
Public Functions
-
template<template<typename> class
CompositorT= compositors::transparent>
autounwrap(CompositorT<typename internal::function_signature<F>::return_type> compositor = CompositorT<typename internal::function_signature<F>::return_type>())¶
-
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