Handlers are components that could be used by components::Server to process the incoming requests.
More...
Handlers are components that could be used by components::Server to process the incoming requests.
All the HTTP handlers derive from server::handlers::HttpHandlerBase and override its methods to provide functionality.
See Userver Components for more information on how to register components.
Configuration
All the handlers inherit configuration options from their base classes:
All the components, including handlers, also have the load-enabled option.
Static configuration example:
Here's an example of the full config for the server::handlers::Ping handle.
# yaml
handler-ping:
# Options from server::handlers::HandlerBase
path: /ping
method: GET
task_processor: main-task-processor
max_request_size: 256
max_headers_size: 256
parse_args_from_body: false
# auth: TODO:
url_trailing_slash: strict-match
max_requests_in_flight: 100
request_body_size_log_limit: 128
response_data_size_log_limit: 128
max_requests_per_second: 100
decompress_request: false
throttling_enabled: false
set-response-server-hostname: false
# Options from server::handlers::HttpHandlerBase
log-level: WARNING
# Common component options
load-enabled: true