diff options
Diffstat (limited to 'docs/net.md')
| -rw-r--r-- | docs/net.md | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/docs/net.md b/docs/net.md index e548cb1..9b85c18 100644 --- a/docs/net.md +++ b/docs/net.md @@ -48,13 +48,13 @@ the actual name of the function will change based on what request method you wan ```lua
server:all("*", function(res, req)
if(req['Version'] ~= "HTTP/1.1") then
- res:close()
+ res:stop()
end
end)
...
server:GET("/", function(res, req)
- --version will always be 1.1, as per the middleware
+ --version will always be 1.1, because the request passes through the function sequentially
...
end)
...
@@ -69,7 +69,7 @@ end) 'takes a string
sends the string to the client, constructs a header on first call (whether or not res.header._sent is null)
-(the constructed header can not be changed later on in the request), and sends the string without closing the client
+(the constructed header can not be changed later on in the request*), and sends the string without closing the client
```lua
...
@@ -78,6 +78,8 @@ res:write("<h1>good bye world</h1>") ...
```
+*well it can but it wont do anything
+
#### res:send
'takes a string
@@ -94,6 +96,12 @@ res:send("<h1>hello world</h1>") closes connection, sets res.client_fd to -1, any calls that use this value will fail
+this will still run any selected functions!
+
+#### res:stop
+
+prevents all further selected functions from running
+
#### 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
|
