diff --git a/examples/embedded_c/embedded_c.c b/examples/embedded_c/embedded_c.c index 9a91e4b4..30697408 100644 --- a/examples/embedded_c/embedded_c.c +++ b/examples/embedded_c/embedded_c.c @@ -26,6 +26,9 @@ int ExampleHandler(struct mg_connection *conn, void *cbdata) mg_printf(conn, "HTTP/1.1 200 OK\r\nContent-Type: text/html\r\n\r\n"); mg_printf(conn, "
"); mg_printf(conn, "To see a page from the A handler click here
"); + mg_printf(conn, "To see a page from the A/B handler click here
"); + mg_printf(conn, "To see a page from the *.foo handler click here
"); mg_printf(conn, "To exit click here
", EXIT_URI); mg_printf(conn, "\n"); @@ -60,9 +63,14 @@ int ABHandler(struct mg_connection *conn, void *cbdata) int FooHandler(struct mg_connection *conn, void *cbdata) { + /* Handler may access the request info using mg_get_request_info */ + struct mg_request_info * req_info = mg_get_request_info(conn); + mg_printf(conn, "HTTP/1.1 200 OK\r\nContent-Type: text/html\r\n\r\n"); mg_printf(conn, ""); mg_printf(conn, "The request was:
%s %s HTTP/%s", + req_info->request_method, req_info->uri, req_info->http_version); mg_printf(conn, "\n"); return 1; }