From 7b0f78af56abff1469b410aa44fe339a50ef8c06 Mon Sep 17 00:00:00 2001 From: NADAL Jean-Baptiste Date: Fri, 20 Dec 2019 18:14:10 +0100 Subject: [PATCH] add doc --- docs/api_http | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 docs/api_http diff --git a/docs/api_http b/docs/api_http new file mode 100644 index 0000000..477ed2c --- /dev/null +++ b/docs/api_http @@ -0,0 +1,29 @@ + mg_set_request_handler(ctx, + "/form", + FileHandler, + (void *)"../../test/form.html"); + + mg_set_request_handler(ctx, EXAMPLE_URI, ExampleHandler, 0); + mg_set_request_handler(ctx, EXIT_URI, ExitHandler, 0); + + /* mg_set_request_handler + Sets or removes a URI mapping for a request handler. + This function uses mg_lock_context internally. + URI's are ordered and prefixed URI's are supported. For example, + consider two URIs: /a/b and /a + /a matches /a + /a/b matches /a/b + /a/c matches /a + Parameters: + ctx: server context + uri: the URI (exact or pattern) for the handler + handler: the callback handler to use when the URI is requested. + If NULL, an already registered handler for this URI will + be removed. + The URI used to remove a handler must match exactly the + one used to register it (not only a pattern match). + cbdata: the callback data to give to the handler when it is called. */ +CIVETWEB_API void mg_set_request_handler(struct mg_context *ctx, + const char *uri, + mg_request_handler handler, + void *cbdata); \ No newline at end of file