From fe247748480c722f0fbb41f5bf2203972af7e851 Mon Sep 17 00:00:00 2001 From: Jef Roosens Date: Fri, 1 Apr 2022 21:50:00 +0200 Subject: [PATCH] Added some docs --- src/web/web.v | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/web/web.v b/src/web/web.v index eb8d5df..000c6a6 100644 --- a/src/web/web.v +++ b/src/web/web.v @@ -217,6 +217,7 @@ pub fn (mut ctx Context) send_response_to_client(mimetype string, res string) bo return true } +// text responds to a request with some plaintext. pub fn (mut ctx Context) text(status http.Status, s string) Result { ctx.status = status @@ -307,6 +308,8 @@ pub fn (mut ctx Context) file(f_path string) Result { return Result{} } +// status responds with an empty textual response, essentially only returning +// the given status code. pub fn (mut ctx Context) status(status http.Status) Result { return ctx.text(status, '') }