Register handler for prefix. If multiple handlers match a prefix, the first‐registered one will be invoked.

Synopsis

Declared in <httpserver.h>

void
RegisterHTTPHandler(
    std::string const& prefix,
    bool exactMatch,
    HTTPRequestHandler const& handler);

Parameters

Name

Description

prefix

The URI path prefix the handler responds to.

exactMatch

If true, only a request whose path equals prefix matches; otherwise any path starting with prefix matches.

handler

The callback invoked for matching requests.

Created with MrDocs