From ba70b8aef78bf2de4aff47a1732027388c62f9fd Mon Sep 17 00:00:00 2001 From: amy Date: Tue, 30 Jan 2024 11:56:55 -0600 Subject: wrong place whoops --- docs/net.md | 28 +++++++++++++++++++++------- 1 file changed, 21 insertions(+), 7 deletions(-) (limited to 'docs/net.md') diff --git a/docs/net.md b/docs/net.md index 11ae80f..192048e 100644 --- a/docs/net.md +++ b/docs/net.md @@ -32,7 +32,7 @@ closes server 'takes a function with 3 paramaters -first and second are res and req as described in server:GET, the third is a function to move to the next point +first and second are res and req as described in server:GET, the third is a function to move to the next point, executes in the order given and can be chained ```lua server:use(function(res, req, next) @@ -75,7 +75,7 @@ res:send("

hello world

") #### res:set ** -'takes 2 strings, key and value +'takes an even number of strings, key and value pairs set the key to value in the response header, certain keys will affect other values or have other side effects on res:send, listed below @@ -83,17 +83,31 @@ set the key to value in the response header, certain keys will affect other valu |--|--| |Code|Changes response note, ie: (200: OK)| +#### res:close ** + +closes connection + +#### res.header + +table containing all head information, anything added to it will be used, certain keys will affect other values or have other side effects on res:send, listed below + +|key|side effect| +|--|--| +|Code|Changes response note, ie: (200: OK)| ```lua ... -res:set("Content-Type", "text/html") -- Content-Type: text/html +res.header["Code"] = 404 +res.header["test"] = "wowa" +-- new header will have a code of 404 (at the top duh) +-- and a new field "test" +-- +-- HTTP/1.1 404 Not Found +-- ... +-- test: wowa ... ``` -#### res:close ** - -closes connection - ### server:static_serve ** 'takes two strings, first is server serve path, second is local path, being a file or directory -- cgit v1.2.3